click.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // var a_idx = 0;
  2. // jQuery(document).ready(function ($) {
  3. // $("body").click(function (e) {
  4. // // var a = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国", "敬业", "诚信", "友善");
  5. // var $i = $("<span/>").text(a[a_idx]);
  6. // a_idx = (a_idx + 1) % a.length;
  7. // var x = e.pageX,
  8. // y = e.pageY;
  9. // $i.css({
  10. // "z-index": 999999999999999999999999999999999999999999999999999999999999,
  11. // top: y - 20,
  12. // left: x,
  13. // position: "absolute",
  14. // color: "#ff0000",
  15. // "font-size": "20px",
  16. // "text-shadow": "0px 0px 5px #555",
  17. // });
  18. // $("body").append($i);
  19. // $i.animate(
  20. // {
  21. // top: y - 300,
  22. // opacity: 0,
  23. // },
  24. // 1500,
  25. // function () {
  26. // $i.remove();
  27. // }
  28. // );
  29. // });
  30. // });
  31. $("html,body").click(function (e) {
  32. var gcd = new Array("♥", "♥", "♥");
  33. var n = Math.floor(Math.random() * gcd.length);
  34. var $i = $("<b/>").text(gcd[n]);
  35. var x = e.pageX,
  36. y = e.pageY;
  37. $i.css({
  38. "z-index": 99999,
  39. top: y - 20,
  40. left: x - 8,
  41. position: "absolute",
  42. color: "#FF706C",
  43. animation: "heartbeat .25s infinite .15s",
  44. });
  45. $("body").append($i);
  46. $i.animate(
  47. {
  48. opacity: 0,
  49. },
  50. 1500,
  51. function () {
  52. $i.remove();
  53. }
  54. );
  55. e.stopPropagation();
  56. });