axis.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>jquery.pep demo - constrained to axis</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.x').pep({ axis: 'x', debug: true, useCSSTranslation: false });
  14. $('.pep.y').pep({ axis: 'y', debug: true, useCSSTranslation: false });
  15. $('.pep.x.trans').pep({ axis: 'x', debug: true, useCSSTranslation: true });
  16. $('.pep.y.trans').pep({ axis: 'y', debug: true, useCSSTranslation: true });
  17. $('.pep.noease').pep({ axis: 'y', shouldEase: false, debug: true });
  18. });
  19. </script>
  20. <style type="text/css">
  21. body{ padding: 0; margin: 0; }
  22. .pep { width: 100px; height: 100px; background: rgb(243, 200, 200); color: white; opacity: 0.8;}
  23. .x { position: absolute; top: 40px; left: 10px; background: rgb(120, 200, 200); opacity: 0.8;}
  24. .y { position: absolute; top: 60px; left: 30px; background: rgb(243, 120, 200); opacity: 0.8;}
  25. .noease { position: absolute; top: 80px; left: 50px; background: rgb(243, 80, 100); opacity: 0.8;}
  26. </style>
  27. </head>
  28. <body>
  29. <div class="pep x">X</div>
  30. <div class="pep y">Y</div>
  31. <div class="pep x trans">X translation</div>
  32. <div class="pep y trans">Y translation</div>
  33. <div class="pep noease">Y </br> ease disabled</div>
  34. </body>
  35. </html>