Skip to content

Instantly share code, notes, and snippets.

@lixingcong
Created March 8, 2017 05:55
Show Gist options
  • Save lixingcong/7216a415e91b996e7bebc006f0dff5cb to your computer and use it in GitHub Desktop.
Save lixingcong/7216a415e91b996e7bebc006f0dff5cb to your computer and use it in GitHub Desktop.
html续秒js脚本
var _click_count=0;
$("body").bind("click",function(e){
//var n=Math.round(Math.random()*100);//随机数
var $i=$("<b>").text("+"+(++_click_count));
var x=e.pageX,y=e.pageY;
$i.css({
"z-index":99999,
"top":y-15,
"left":x,
"position":"absolute",
"color":"red"
});
$("body").append($i);
$i.animate(
{"top":y-180,"opacity":0},
1500,
function(){$i.remove();}
);
e.stopPropagation();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment