Ei kuvausta

checkVariation-larger.html 946B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <!DOCTYPE html> <title>Basic Visual Test</title>
  2. <style>
  3. @import '/reset.css';
  4. html,
  5. body {
  6. height: 1500px;
  7. }
  8. #reference {
  9. position: absolute;
  10. top: 550px;
  11. left: 50px;
  12. width: 200px;
  13. height: 200px;
  14. background-color: red;
  15. box-shadow: inset 0 0 0 1px black;
  16. }
  17. #popper {
  18. width: 100px;
  19. height: 300px;
  20. background-color: rebeccapurple;
  21. box-shadow: inset 0 0 0 1px black;
  22. }
  23. </style>
  24. <div id="reference">Reference Box</div>
  25. <div id="popper">Popper Box</div>
  26. <script type="module">
  27. import { createPopper } from '../../dist/popper.js';
  28. const reference = document.querySelector('#reference');
  29. const popper = document.querySelector('#popper');
  30. window.instance = createPopper(reference, popper, {
  31. placement: 'right-start',
  32. modifiers: [
  33. {
  34. name: 'preventOverflow',
  35. options: {
  36. rootBoundary: 'document',
  37. },
  38. },
  39. ],
  40. });
  41. </script>