This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--HTML--> | |
<ul id="J_Item"> | |
<li><a href="#">1</a></li> | |
<li><a href="#">2</a></li> | |
<li><a href="#">3</a></li> | |
<li><a href="#">4</a></li> | |
</ul> | |
<!--JavaScript--> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--HTML--> | |
<div id="blog_wrap"> | |
<div class="side"></div> | |
<div class="post"> | |
<img src="/" alt="图片" style="width:900px;height:100px;"/> | |
</div> | |
</div> | |
<!--JavaScript--> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new function(s) | |
{ | |
if(!arguments.length||!s) return null; | |
if(""==s) return 0; | |
var l=0; | |
for(var i=0;i<s.length;i++) | |
{ | |
if(s.charCodeAt(i)>255) | |
{ | |
l+=2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.strip=function() | |
{ | |
if(this.length<2) return [this[0]]||[]; | |
var arr=[]; | |
for(var i=0;i<this.length;i++) | |
{ | |
arr.push(this.splice(i--,1)); | |
for(var j=0;j<this.length;j++) | |
{ | |
if(this[j]==arr[arr.length-1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var maxchar = function(s){ | |
var o = {},t = [0,'']; | |
for(var i = 0 , l = s.length; i < l ; i++){ | |
if(o[s[i]]){ | |
o[s[i]] += 1; | |
if(o[s[i]] > t[0]){ | |
t[0] = o[s[i]]; | |
t[1] = s[i]; | |
} | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.Trim = function() | |
{ | |
return this.replace(/(^\s*)|(\s*$)/g, ""); | |
} | |
var str = ' abcdefg '; | |
console.log(str.trim()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Flexbox 设置为伸缩容器(包括伸缩容器和伸缩项目) | |
* (flex /inline-flex ) | |
*/ | |
display: -webkit-flex; | |
display: flex; | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--HTML--> | |
<div class="flex-container"> | |
<div class="flex-item">I'm centered!</div> | |
</div> | |
<!--CSS--> | |
<style> | |
.flex-container { | |
display: -webkit-flex; | |
display: flex; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*建立数组*/ | |
var Obj = new Array(); | |
var Obj = new Array(size); | |
var Obj = new Array(element0, element1, ..., elementn); | |
/*遍历数组*/ | |
for (var i in Obj) | |
{ | |
console.log(Obj[i]+","); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.top-shadow { | |
width: 200px; | |
height: 200px; | |
} | |
.top-shadow:after { | |
content: ""; | |
width: 100%; | |
height: 8px; | |
display: block; |
OlderNewer