options-useBothWheelAxes.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link href="../css/perfect-scrollbar.css" rel="stylesheet">
  5. <script src="../dist/perfect-scrollbar.js"></script>
  6. <style>
  7. .container {
  8. position: relative;
  9. margin: 30px auto;
  10. padding: 0px;
  11. width: 600px;
  12. height: 400px;
  13. overflow: auto;
  14. }
  15. .container .content-x {
  16. background-image: url('./assets/azusa.jpg');
  17. width: 1280px;
  18. height: 400px;
  19. color: blue;
  20. font-size: 20px;
  21. }
  22. .container .content-y {
  23. background-image: url('./assets/azusa.jpg');
  24. width: 600px;
  25. height: 720px;
  26. color: blue;
  27. font-size: 20px;
  28. }
  29. </style>
  30. </head>
  31. <body>
  32. <div class="container">
  33. <div class="content-x">
  34. useBothWheelAxes: x
  35. </div>
  36. </div>
  37. <div class="container">
  38. <div class="content-y">
  39. useBothWheelAxes: y
  40. </div>
  41. </div>
  42. <script>
  43. var containers = document.querySelectorAll('.container');
  44. new PerfectScrollbar(containers[0], {
  45. useBothWheelAxes: true
  46. });
  47. new PerfectScrollbar(containers[1], {
  48. useBothWheelAxes: true
  49. });
  50. </script>
  51. </body>
  52. </html>