heart.js 529B

1234567891011121314151617181920212223242526
  1. jQuery(document).ready(function ($) {
  2. $("html,body").click(function (e) {
  3. // var n = Math.round(Math.random() * 100);
  4. var n = 1;
  5. var $i = $("<b/>").text("+" + n);
  6. var x = e.pageX,
  7. y = e.pageY;
  8. $i.css({
  9. "z-index": 99999,
  10. "top": y - 20,
  11. "left": x,
  12. "position": "absolute",
  13. "color": "#fff"
  14. // "color": "#C6B0EA"
  15. });
  16. $("body").append($i);
  17. $i.animate({
  18. "top": y - 80,
  19. "opacity": 0
  20. }, 1500, function () {
  21. $i.remove();
  22. });
  23. e.stopPropagation();
  24. });
  25. });