| 1 |
<!DOCTYPE html> <title>Basic Visual Test</title> |
| 2 |
|
| 3 |
<style> |
| 4 |
@import '/reset.css'; |
| 5 |
.scroll { |
| 6 |
overflow: scroll; |
| 7 |
width: 300px; |
| 8 |
height: 300px; |
| 9 |
background-color: grey; |
| 10 |
position: relative; |
| 11 |
} |
| 12 |
|
| 13 |
.scroll2 { |
| 14 |
width: 600px; |
| 15 |
height: 600px; |
| 16 |
background-color: darkgrey; |
| 17 |
} |
| 18 |
|
| 19 |
.scroll::before { |
| 20 |
content: 'before'; |
| 21 |
display: block; |
| 22 |
height: 300px; |
| 23 |
width: 1px; |
| 24 |
} |
| 25 |
|
| 26 |
.scroll::after { |
| 27 |
content: 'after'; |
| 28 |
display: block; |
| 29 |
height: 300px; |
| 30 |
width: 1px; |
| 31 |
} |
| 32 |
|
| 33 |
#reference { |
| 34 |
width: 200px; |
| 35 |
height: 200px; |
| 36 |
background-color: red; |
| 37 |
box-shadow: inset 0 0 0 1px black; |
| 38 |
} |
| 39 |
|
| 40 |
#popper { |
| 41 |
width: 100px; |
| 42 |
height: 100px; |
| 43 |
background-color: rebeccapurple; |
| 44 |
box-shadow: inset 0 0 0 1px black; |
| 45 |
} |
| 46 |
</style> |
| 47 |
|
| 48 |
<div class="scroll scroll2"> |
| 49 |
<div class="scroll scroll1"> |
| 50 |
<div id="reference">Reference Box</div> |
| 51 |
</div> |
| 52 |
</div> |
| 53 |
<div id="popper">Popper Box</div> |
| 54 |
|
| 55 |
<script type="module"> |
| 56 |
import { createPopper } from '../../dist/popper.js'; |
| 57 |
const reference = document.querySelector('#reference'); |
| 58 |
const popper = document.querySelector('#popper'); |
| 59 |
|
| 60 |
window.instance = createPopper(reference, popper, { |
| 61 |
placement: 'bottom', |
| 62 |
modifiers: [ |
| 63 |
{ |
| 64 |
name: 'flip', |
| 65 |
options: { |
| 66 |
fallbackPlacements: ['bottom', 'right'], |
| 67 |
altBoundary: true, |
| 68 |
}, |
| 69 |
}, |
| 70 |
{ |
| 71 |
name: 'preventOverflow', |
| 72 |
options: { |
| 73 |
altBoundary: true, |
| 74 |
}, |
| 75 |
}, |
| 76 |
], |
| 77 |
}); |
| 78 |
</script> |