Nessuna descrizione

altAxis-false.html 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. position: relative;
  10. }
  11. .scroll2 {
  12. width: 600px;
  13. height: 600px;
  14. background-color: darkgrey;
  15. }
  16. .scroll::before {
  17. content: 'before';
  18. display: block;
  19. height: 300px;
  20. width: 1px;
  21. }
  22. .scroll::after {
  23. content: 'after';
  24. display: block;
  25. height: 300px;
  26. width: 1px;
  27. }
  28. #reference {
  29. width: 200px;
  30. height: 200px;
  31. background-color: red;
  32. box-shadow: inset 0 0 0 1px black;
  33. }
  34. #popper {
  35. width: 100px;
  36. height: 100px;
  37. background-color: rebeccapurple;
  38. box-shadow: inset 0 0 0 1px black;
  39. }
  40. </style>
  41. <div class="scroll scroll2">
  42. <div class="scroll scroll1">
  43. <div id="reference">Reference Box</div>
  44. <div id="popper">Popper Box</div>
  45. </div>
  46. </div>
  47. <script type="module">
  48. import { createPopper } from '../../dist/popper.js';
  49. const reference = document.querySelector('#reference');
  50. const popper = document.querySelector('#popper');
  51. window.instance = createPopper(reference, popper, {
  52. placement: 'bottom',
  53. modifiers: [
  54. {
  55. name: 'flip',
  56. options: {
  57. fallbackPlacements: ['bottom', 'right', 'top'],
  58. altAxis: false,
  59. },
  60. },
  61. ],
  62. });
  63. </script>