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
/* | |
* 页面背景设置为透明网格样式 | |
*/ | |
body { | |
background-color: #fff; | |
background-image: | |
linear-gradient(45deg, #d6d6d6 25%, transparent 25%, transparent 75%, #d6d6d6 75%, #d6d6d6), | |
linear-gradient(45deg, #d6d6d6 25%, transparent 25%, transparent 75%, #d6d6d6 75%, #d6d6d6); | |
background-size: 16px 16px; |
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
// 该函数可以返回传递给它的任意对象的类 | |
function classof(o) { | |
if( o === "null" ) return "Null"; | |
if( o === "undefined") return "Undefined"; | |
Object.prototype.toString.call(o).slice(8,-1); | |
} | |
//或者,将 Object.prototype 替换为 {} 也是可以的 |
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 chromeType = navigator.userAgent.toLowerCase(); | |
var bType = ''; | |
function getBrowserType() { | |
if ("ActiveXObject" in window) { | |
bType = 'ie'; | |
} else if (chromeType.indexOf('firefox') > -1) { | |
bType = "firefox"; | |
} else if (chromeType.indexOf('opera') > -1 || chromeType.indexOf('opr') > -1) { | |
bType = "opera"; | |
} else if (chromeType.indexOf('safari') > -1 && chromeType.indexOf('chrome') == -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
jQuery(document).ready(function($) { | |
$("html,body").click(function(e){ | |
var n=Math.round(Math.random()*100);//随机数 | |
var $i=$("<b/>").text("+"+n);//添加到页面的元素 | |
var x=e.pageX, y=e.pageY;//鼠标点击的位置 | |
$i.css({ | |
"z-index":99999, |
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
window.onload = function(){ | |
var ua = window.navigator.userAgent.toLowerCase(); | |
if(ua.match(/MicroMessenger/i) == 'micromessenger'){ | |
return true; | |
}else{ | |
return false; | |
} | |
} |
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
eval(z='p="<"+"pre>"/* ,.oq#+ ,._, */;for(y in n="zw24l6k\ | |
4e3t4jnt4qj24xh2 x/* =<,m#F^ A W###q. */42kty24wrt413n243n\ | |
9h243pdxt41csb yz/* #K q##H######Am */43iyb6k43pk7243nm\ | |
r24".split(4)){/* dP cpq#q##########b, */for(a in t=pars\ | |
eInt(n[y],36)+/* p##@###YG=[#######y */(e=x=r=[]))for\ | |
(r=!r,i=0;t[a/* d#qg `*PWo##q#######D */]>i;i+=.05)wi\ | |
th(Math)x-= /* aem1k.com Q###KWR#### W[ */.05,0>cos(o=\ | |
new Date/1e3/* .Q#########Md#.###OP A@ , */+x/PI)&&(e[~\ | |
~(32*sin(o)*/* , (W#####Xx######.P^ T % */sin(.5+y/7))\ | |
+60] =-~ r);/* #y `^TqW####P###BP */for(x=0;122>\ |
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
<?php | |
//explode用法: | |
$var = '10, 24, 29, 32, 56'; | |
$ary = explode(",", $var); | |
print_r ( $ary ); // Array ( [0] => 10 [1] => 24 [2] => 29 [3] => 32 [4] => 56 ) | |
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
<?php | |
function get_con(){ | |
global $post; | |
$content = get_the_content(); | |
//获取内容的第一段 | |
$str = wpautop( $content ); | |
$str = substr( $str, 0, strpos( $str, '</p>' ) + 4 ); |
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
<?php | |
/* | |
* | |
* 通常使用 is_home() 函数即可判断首页,但是有时候在首页不起作用 | |
* | |
*/ | |
if( is_home() || is_front_page() ) { |
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 arr = ['a','b','c','d','e','f'] | |
var str = 'b'; | |
console.log( $.inArray(str , arr) ); | |
//结果: |
NewerOlder