暫無描述

scroll.html 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!DOCTYPE html> <title>Basic Visual Test</title>
  2. <style>
  3. @import '/reset.css';
  4. #scroll {
  5. overflow: scroll;
  6. width: 300px;
  7. height: 300px;
  8. background-color: grey;
  9. }
  10. #scroll::before {
  11. content: 'before';
  12. display: block;
  13. height: 300px;
  14. width: 1px;
  15. }
  16. #scroll::after {
  17. content: 'after';
  18. display: block;
  19. height: 300px;
  20. width: 1px;
  21. }
  22. #reference {
  23. width: 200px;
  24. height: 200px;
  25. background-color: red;
  26. box-shadow: inset 0 0 0 1px black;
  27. }
  28. #popper {
  29. width: 100px;
  30. height: 100px;
  31. background-color: rebeccapurple;
  32. box-shadow: inset 0 0 0 1px black;
  33. }
  34. </style>
  35. <div id="scroll">
  36. <div id="reference">Reference Box</div>
  37. <div id="popper">Popper Box</div>
  38. </div>
  39. <script type="module">
  40. import { createPopper } from '../dist/popper.js';
  41. const reference = document.querySelector('#reference');
  42. const popper = document.querySelector('#popper');
  43. window.instance = createPopper(reference, popper, {
  44. placement: 'right',
  45. strategy: 'fixed',
  46. });
  47. </script>