disabling.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>jquery.pep demo - disabling</title>
  6. <!-- Load local jQuery. -->
  7. <script src="../libs/jquery/jquery.js"></script>
  8. <script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
  9. <!-- Load local lib and tests. -->
  10. <script src="../src/jquery.pep.js"></script>
  11. <script type="text/javascript">
  12. $(document).ready(function(){
  13. $('.toggle').bind("click touchstart", function(ev){
  14. $(this).parent()
  15. .toggleClass('disabled')
  16. .data('plugin_pep')
  17. .toggle();
  18. });
  19. $('.pep').pep({
  20. debug: true,
  21. elementsWithInteraction: 'button'
  22. });
  23. });
  24. </script>
  25. <style type="text/css">
  26. .pep{ width: 200px; height: 200px; background: blue; opacity: 0.6; }
  27. .pep.disabled{ background: #eee; }
  28. .pep-1 { position: absolute; top: 10px; left: 10px; }
  29. .pep-2 { position: absolute; top: 60px; left: 50px; }
  30. .pep-3 { position: absolute; top: 110px; left: 90px; }
  31. .pep-4 { position: absolute; top: 160px; left: 130px; }
  32. </style>
  33. </head>
  34. <body>
  35. <div class="pep pep-1">
  36. <button class="toggle">Toggle</button>
  37. </div>
  38. <div class="pep pep-2">
  39. <button class="toggle">Toggle</button>
  40. </div>
  41. <div class="pep pep-3">
  42. <button class="toggle">Toggle</button>
  43. </div>
  44. <div class="pep pep-4">
  45. <button class="toggle">Toggle</button>
  46. </div>
  47. </body>
  48. </html>