Guest User

Untitled

a guest
Sep 9th, 2015
70
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8" />
  5.     <link rel="stylesheet" href="css/font-awesome.min.css">
  6.     <link rel="stylesheet" href="style1.css">
  7.     <script type="text/javascript" src="js/jquery-2.1.4.min.js" />
  8. </head>
  9. <body>
  10.  
  11.  
  12.     <script>
  13.     var intervalId;
  14.     var clicked = 0;
  15.     var buttonID = 0;
  16.  
  17.     $("button").mousedown(function() {
  18.         consol.log("yes");
  19.         buttonID = $(this).attr('id');
  20.         intervalId = setInterval(dosom, 500);
  21.     }).mouseup(function() {
  22.         clicked = 0;
  23.        
  24.         clearInterval(intervalId);
  25.     });
  26.  
  27.     function dosom() {
  28.         clicked += 1;
  29.         $("#demo").html("button: "+buttonID+" clicked : "+clicked);
  30.     }
  31.  
  32.  
  33.     </script>
  34.     <div class="cadre">
  35.         <div class="guide1">
  36.  
  37.             <button id="btn1" class="fa fa-chevron-circle-left fa-4x tai1 btnd "></button>
  38.  
  39.             <button id="btn2" class="fa fa-chevron-circle-right fa-4x tai1 btng"></button>
  40.         </div>
  41.  
  42.  
  43.  
  44.         <div class="guide2">
  45.             <button id="btn3" class="fa fa-chevron-circle-up fa-4x tai2 btnh"></button>
  46.             <br>
  47.             <button id="btn4" class="fa fa-chevron-circle-down fa-4x tai2 btnb" ></button>
  48.         </div>
  49.     </div>
  50.  
  51.     <p id="demo"> pp : </p>
  52.  
  53.  
  54.  
  55.  
  56. </body>
  57. </html>
RAW Paste Data