return-false-init.html 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>jquery.pep demo - </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. $('.pep').pep({
  14. initiate: function(){
  15. if ( this.$el.hasClass('no-drag') ){
  16. this.toggle(false);
  17. return false;
  18. }
  19. }
  20. });
  21. });
  22. </script>
  23. <style type="text/css">
  24. .pep{ width: 200px; height: 200px; background: blue; opacity: 0.6; color: white; }
  25. .pep-1 { position: absolute; top: 50px; left: 10px; }
  26. .pep-2 { position: absolute; top: 100px; left: 50px; }
  27. </style>
  28. </head>
  29. <body>
  30. <div class="pep pep-1"></div>
  31. <div class="pep pep-2 no-drag">no drag</div>
  32. </body>
  33. </html>