custom-constraint-2.html 860 B

123456789101112131415161718192021222324252627282930313233343536
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>jquery.pep custom constraint 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. axis: 'y',
  15. constrainTo: [100, false, $(window).innerHeight() - 100, false]
  16. })
  17. });
  18. </script>
  19. <style type="text/css">
  20. html, body{ overflow: hidden; }
  21. .pep{ height: 1000px; width: 100%; position: absolute; top: 100px; left: 0; background: blue }
  22. </style>
  23. </head>
  24. <div class='pep'></div>
  25. </body>
  26. </html>