scrollbars-with-margin.html 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=utf-8">
  5. <title>perfect-scrollbar example</title>
  6. <link href="../dist/css/perfect-scrollbar.css" rel="stylesheet">
  7. <script src="../dist/js/perfect-scrollbar.js"></script>
  8. <style>
  9. h1 { text-align: center; }
  10. .container { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: auto; }
  11. .container .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; }
  12. .large-margin .ps-scrollbar-x-rail {
  13. margin: 0 25%;
  14. opacity: 0.5;
  15. background-color: #eee;
  16. }
  17. .large-margin .ps-scrollbar-y-rail {
  18. margin: 100px 0;
  19. opacity: 0.5;
  20. background-color: #eee;
  21. }
  22. </style>
  23. </head>
  24. <body>
  25. <h1>Default</h1>
  26. <div class="container">
  27. <div class="content">
  28. </div>
  29. </div>
  30. <h1>Margins</h1>
  31. <div class="container large-margin">
  32. <div class="content">
  33. </div>
  34. </div>
  35. <script>
  36. window.onload = function () {
  37. [].forEach.call(document.querySelectorAll('.container'), function (el) {
  38. Ps.initialize(el);
  39. });
  40. };
  41. </script>
  42. </body>
  43. </html>