index.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
  6. <meta name="apple-mobile-web-app-capable" content="yes">
  7. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  8. <title>疯狂挠一挠——艾玛,手指痒死了</title>
  9. <link rel="stylesheet" href="style.css"/>
  10. </head>
  11. <body>
  12. <div id="status">
  13. <p class="fen">你挠了 <span id="num">0</span> 下呦~</p>
  14. <p class="fen" style="font-size: 24px;">剩余 <span id="second">10</span> s</p>
  15. </div>
  16. <div id="nao-box">挠我,挠我</div>
  17. <div id="mask" style="display: none"></div>
  18. <div id="share" style="display: none">
  19. <p id="share-btn">分享一下</p>
  20. <p id="again-btn">再玩一次</p>
  21. </div>
  22. <img id="share-img" src="share.png" alt="" style="display:none; position: absolute; right: 0;top: 0;z-index: 1111;"/>
  23. <div class="ads" style="position: absolute; bottom: 20px;padding-left: 20px; width: 100%;z-index: 11111;">
  24. <a align="center" style="color:white; position:absolute; bottom: 0; left: 10px; " href="http://game.ikongzhong.cn">更多游戏</a>
  25. <a align="center" style="color:white; position:absolute; bottom: 0; right: 30px;" href="http://game.ikongzhong.cn/games/dianji">疯狂点击</a>
  26. </div>
  27. </body>
  28. <script type="text/javascript" src="zepto.min.js"></script>
  29. <script type="text/javascript">
  30. document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
  31. $(function() {
  32. var can = true;
  33. var total = 10;
  34. var init = true ;
  35. var sec = function() {
  36. total = total - 1;
  37. $("#second").text(total);
  38. console.log(total)
  39. if(total == 0) {
  40. can = false;
  41. clearInterval(timer);
  42. $("#share,#mask").show();
  43. }
  44. }
  45. $("body").swipe(function() {
  46. if(init == true) {
  47. timer = setInterval(sec, 1000);
  48. init = false;
  49. }
  50. if(can === true) {
  51. var n = Number($("#num").text());
  52. var m = n + 1;
  53. $("#num").text(m);
  54. }
  55. });
  56. $("#share-btn").tap(function() {
  57. $("#share-img").show().off("click").tap(function() {
  58. $(this).hide();
  59. });
  60. var nn = $("#num").text();
  61. document.title = '艾玛,10秒,我玩命挠了'+ nn + '下,你们快也挠挠~';
  62. });
  63. $("#again-btn").tap(function() {
  64. $("#share,#mask").hide();
  65. $("#second").text('10');
  66. $("#num").text('0');
  67. total = 10;
  68. init = true;
  69. can = true;
  70. });
  71. })
  72. </script>
  73. <img src="http://img.tongji.linezing.com/3455448/tongji.gif">
  74. </html>