This file contains hidden or 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
// SSDB | |
var SSDB = require('ssdb'); | |
__SSDB = SSDB.createClient({ | |
host: '127.0.0.1', | |
port: 8888, | |
timeout: 10 | |
}); | |
__SSDB.thunkify(); |
This file contains hidden or 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
!function(){ | |
if($('#J_Xx_Feed_Collect').length > 0){ | |
return; | |
} | |
var day = /(\d{8})/.exec(location.href); | |
day = day[1]; | |
var today = Math.floor((+ new Date()) / ( 24 * 60 * 60 * 1000)) * ( 24 * 60 * 60 * 1000); | |
var currentDay = new Date(day.substr(0,4) + '-' + day.substr(4,2) + '-' + day.substr(6,2)); |
This file contains hidden or 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 xhr = new XMLHttpRequest(); | |
if( !xhr ){ | |
xhr = new ActiveXObject("Microsoft.XMLHTTP"); | |
} | |
xhr.open("HEAD",location.href,true); | |
xhr.onreadystatechange=function(){ | |
if( xhr.readyState == 4 && xhr.status == 200 ){ | |
console.log(xhr.getResponseHeader("Date")); | |
} | |
} |
This file contains hidden or 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 max = 0; | |
var maxEle; | |
KISSY.each(KISSY.query('*'), function(i){ | |
if(KISSY.DOM.css(i, 'z-index') == 'auto'){return;} | |
var index = parseInt(KISSY.DOM.css(i, 'z-index')); | |
if(max < index){ | |
max = index; | |
maxEle = i; | |
} | |
console.log(index); |
This file contains hidden or 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
.gradient{ | |
width:300px; | |
height:150px; | |
filter:alpha(opacity=100 finishopacity=50 style=1 startx=0,starty=0,finishx=0,finishy=150) progid:DXImageTransform.Microsoft.gradient(startcolorstr=red,endcolorstr=blue,gradientType=0); | |
-ms-filter:alpha(opacity=100 finishopacity=50 style=1 startx=0,starty=0,finishx=0,finishy=150) progid:DXImageTransform.Microsoft.gradient(startcolorstr=red,endcolorstr=blue,gradientType=0);/*IE8*/ | |
background:red; /* 一些不支持背景渐变的浏览器 */ | |
background:-moz-linear-gradient(top, red, rgba(0, 0, 255, 0.5)); | |
background:-webkit-gradient(linear, 0 0, 0 bottom, from(#ff0000), to(rgba(0, 0, 255, 0.5))); | |
background:-o-linear-gradient(top, red, rgba(0, 0, 255, 0.5)); | |
} |
This file contains hidden or 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
/*悬浮建议按钮*/ | |
#J_Feed { | |
height: auto; | |
margin-left: 999px; | |
position: fixed; | |
_position: absolute; | |
top: 260px; | |
_top: expression(eval(documentElement.scrollTop+263)); | |
cursor: pointer; | |
} |
This file contains hidden or 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
/** | |
* js 对象序列化 | |
* @param obj | |
* @return {String} | |
*/ | |
function serialize(obj){ | |
switch(obj.constructor){ | |
case Object: | |
var str = "{"; | |
for(var o in obj){ |
This file contains hidden or 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
.box { | |
/*非IE的主流浏览器识别的垂直居中的方法*/ | |
display: table-cell; | |
vertical-align:middle; | |
/*设置水平居中*/ | |
text-align:center; | |
/* 针对IE的Hack */ | |
*display: block; |
This file contains hidden or 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
filter:alpha(opacity=50); /* IE */ | |
-moz-opacity:0.5; /* Moz + FF */ | |
opacity: 0.5; /* 支持CSS3的浏览器(FF 1.5也支持)*/ |
NewerOlder