grid.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>jquery.pep demo - grid</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.one').pep({
  14. grid: [80,80],
  15. shouldEase: false
  16. });
  17. $('.pep.two').pep({
  18. grid: [120,120],
  19. shouldEase: false
  20. });
  21. });
  22. </script>
  23. <style type="text/css">
  24. .pep{
  25. width: 80px; height: 80px; background: blue; position: absolute;
  26. top: 20px; left: 20px;
  27. }
  28. .pep.two{
  29. background: red; width: 160px; height: 160px; top: 140px;
  30. }
  31. body{
  32. background-color: #eee;
  33. background-image:
  34. linear-gradient(
  35. 0deg, transparent 24%, rgba(0, 0, 0, 0.6) 25%, rgba(0, 0, 0, 0.6) 26%, transparent 27%, transparent 74%, rgba(0, 0, 0, 0.6) 75%, rgba(0, 0, 0, 0.6) 76%, transparent 77%, transparent), linear-gradient(90deg, transparent 24%, rgba(0, 0, 0, 0.6) 25%, rgba(0, 0, 0, 0.6) 26%, transparent 27%, transparent 74%, rgba(0, 0, 0, 0.6) 75%, rgba(0, 0, 0, 0.6) 76%, transparent 77%, transparent);
  36. height:100%;
  37. background-size:80px 80px;
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <div class='container'>
  43. <div class="pep one"></div>
  44. <div class="pep two"></div>
  45. </div>
  46. </body>
  47. </html>