Ei kuvausta

viewport.html 984B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <!DOCTYPE html> <title>Mobile Viewport Visual Test</title>
  2. <style>
  3. body {
  4. display: flex;
  5. }
  6. .push {
  7. width: 2000px;
  8. height: 200px;
  9. background: gray;
  10. flex-shrink: 0;
  11. }
  12. #reference {
  13. width: 200px;
  14. height: 200px;
  15. background-color: red;
  16. box-shadow: inset 0 0 0 1px black;
  17. flex-shrink: 0;
  18. }
  19. #popper {
  20. width: 100px;
  21. height: 100px;
  22. background-color: rebeccapurple;
  23. box-shadow: inset 0 0 0 1px black;
  24. }
  25. </style>
  26. <div class="push"></div>
  27. <div id="reference">Reference Box</div>
  28. <div id="popper">Popper Box</div>
  29. <script type="module">
  30. import { createPopper } from '../dist/popper.js';
  31. const reference = document.querySelector('#reference');
  32. const popper = document.querySelector('#popper');
  33. window.instance = createPopper(reference, popper, {
  34. placement: 'top',
  35. modifiers: [
  36. {
  37. name: 'preventOverflow',
  38. options: {
  39. tether: false,
  40. },
  41. },
  42. ],
  43. });
  44. </script>