File: test.html

package info (click to toggle)
node-popper2 2.11.2-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,752 kB
  • sloc: javascript: 23,558; makefile: 20
file content (42 lines) | stat: -rw-r--r-- 892 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html> <title>Basic Visual Test</title>

<style>
  @import '/reset.css';
  #reference {
    background-color: red;
    width: 100px;
    height: 50px;
    position: absolute;
    left: 104.5px;
    box-shadow: inset 0 0 0 2px #000;
  }

  #popper {
    background-color: rebeccapurple;
    width: 300px;
    height: 400px;
    width: 312px;
    box-shadow: inset 0 0 0 2px #000;
  }
</style>

<div id="reference">Reference Box</div>
<div id="popper">Popper Box</div>

<script type="module">
  import { createPopper } from './dist/popper.js';
  const reference = document.querySelector('#reference');
  const popper = document.querySelector('#popper');

  window.instance = createPopper(reference, popper, {
    placement: 'bottom-start',
    modifiers: [
      {
        name: 'preventOverflow',
        options: {
          altAxis: true,
        },
      },
    ],
  });
</script>