Click the mouse, red random number rise special effect code
-
/** -
*Add the special effect of clicking red numbers to the website -
* http://wosn.net/301.html -
*/ -
<script> -
jQuery(document).ready(function($) { -
var _click_count= zero ; -
$( "body" ).bind( "click" ,function(e){ //Give the body an event directly -
var n=Math.round(Math.random()* one hundred ); //Random number -
// var $i=$("<b>").text("+"+(++_click_count));// Elements added to the page -
var $i=$( "<b>" ).text( "+" +(++n)); //Elements added to the page -
var x=e.pageX,y=e.pageY; //Mouse click position -
$i.css({ -
"z-index" : ninety-nine thousand nine hundred and ninety-nine , -
"top" :y- fifteen , -
"left" :x, -
"position" : "absolute" , -
"color" : "red" -
}); -
$( "body" ).append($i); -
$i.animate( -
{ "top" :y- one hundred and eighty , "opacity" : zero }, -
one thousand and five hundred , -
function(){$i.remove();} -
); -
e.stopPropagation(); -
}); -
}); -
</script>
Click the mouse, the red slogan rises the special effect code
-
/** -
*Add a special effect to the website by clicking the red slogan -
* http://wosn.net/301.html -
*/ -
<script type= "text/javascript" > -
var a_idx = zero ; -
jQuery(document).ready(function($) { -
$( "body" ).click(function(e) { -
var a = new Array( "Rich and strong" , Democracy , "Civilization" , "Harmony" , Freedom , Equality , "Justice" , "Rule of law" , "Patriotic" , "Dedicated" , "Integrity" , Friendly ); -
var $i = $( "<span/>" ).text(a[a_idx]); -
a_idx = (a_idx + one ) % a.length; -
var x = e.pageX, -
y = e.pageY; -
$i.css({ -
"z-index" : 9999999999999999999999999999999999999999 , -
"top" : y - twenty , -
"left" : x, -
"position" : "absolute" , -
"font-weight" : "bold" , -
"color" : "#ff6651" -
}); -
$( "body" ).append($i); -
$i.animate({ -
"top" : y - one hundred and eighty , -
"opacity" : zero -
}, -
one thousand and five hundred , -
function() { -
$i.remove(); -
}); -
}); -
}); -
</script>