一切福田,不離方寸,從心而覓,感無不通。

网页变模糊js代码

<![if !IE]>
<script>
/*
* by moli
*/
$(document).ready(function(){
if(document.cookie.indexOf("lu=") == -1 ){
// 延时2秒
setTimeout("jQuery.mxblur.interID = setInterval('jQuery.mxblur.begin()', 5)", 1500);
}
});

$.mxblur = {
interID : null,
num: 0.01,
begin : function() {
jQuery.mxblur.blur( jQuery.mxblur.num );
if(jQuery.mxblur.num > 3) {
jQuery.mxblur.num = 0;
if(confirm("少年!是不是代码写多了?眼睛模糊了?")) {
alert("太累啦,就该歇歇啦,愚人节快乐:)");
clearInterval(jQuery.mxblur.interID );
jQuery.mxblur.blur(0);
document.cookie = "lu=lu";
}
}
jQuery.mxblur.num = jQuery.mxblur.num + 1 /100;
},
blur : function() {
$("body").css("-webkit-filter","blur("+$.mxblur.num+"px)");
$("body").css("-moz-filter","blur("+$.mxblur.num+"px)");
$("body").css("-o-filter","blur("+$.mxblur.num+"px)");
$("body").css("-ms-filter","blur("+$.mxblur.num+"px)");
$("body").css("filter","blur("+$.mxblur.num+"px)");
$("body").css("filter","url(blur.svg#"+ $.mxblur.num.toFixed(1) +")");
}
}
</script>
<![endif]>

 

from:http://www.oschina.net/code/snippet_563269_34669