Advertisement
Guest User

Untitled

a guest
Nov 29th, 2012
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.84 KB | None | 0 0
  1. <html>
  2. <head>
  3.   <script src="http://code.jquery.com/jquery-latest.js"></script>
  4. </head>
  5. <body>
  6. <div class="motor">
  7.     <button class="run" href="#">Click to start/stop motor</button><br/>
  8.  </div>
  9. <br/>
  10. Status : <span id="status">0</span> >>
  11.        <span id="status2">Stopped</span><br>
  12.        <span id="status_amp">0</span> A
  13.  
  14.   <script>
  15.  var running = "Motor is running";
  16. var stopped = "Motor is stopped";
  17. var amp = "0,96";
  18. var amp_stopped = "0"
  19.      
  20.       $("button").mouseup(function(){
  21.            var etta = 1;
  22.     $('#status').html(etta);
  23.     $('#status2').html(stopped);
  24.     $('#status_amp').html(amp_stopped);      
  25.     // do post
  26.    
  27.      
  28.     }).mousedown(function(){
  29.            var nolla = 0;
  30.  
  31.     $('#status').html(nolla);
  32.     $('#status2').html(running);
  33.     $('#status_amp').html(amp);
  34.     //do post
  35.  
  36.     });
  37. </script>
  38. </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement