见图案
代码附上:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
<title></title>
</head>
<body>
<div class="divclass" style="margin-top: 50%;">
页面元素
</div>
</body>
<script src="../js/zepto.min.js"></script>
<script>
$("html,body").on("click",".divclass",function(e){
anp(e);
})
function anp(e) {
var $i = $("<b>").text("+" + 1);
var x = e.pageX,
y = e.pageY;
$i.css({
top: y - 20,
left: x,
position: "absolute",
color: "#E94F06"
});
$("body").append($i);
$i.animate({
top: y - 120,
opacity: 0,
"font-size": "1.4em"
}, 1500, function() {
$i.remove();
});
e.stopPropagation();
}
</script>
</html>