Last active
April 29, 2020 08:43
-
-
Save FezVrasta/3a59b77636b97379c28497d5ee85af96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body { | |
display: flex; | |
} | |
.push { | |
width: 2000px; | |
height: 200px; | |
background: gray; | |
flex-shrink: 0; | |
} | |
#popcorn { | |
width: 200px; | |
height: 200px; | |
background: green; | |
display: inline-block; | |
flex-shrink: 0; | |
} | |
#tooltip { | |
background-color: #333; | |
color: white; | |
padding: 5px 10px; | |
border-radius: 4px; | |
font-size: 13px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="push"></div> | |
<div id="popcorn"></div> | |
<div id="tooltip"> | |
tooltip | |
</div> | |
<script src="https://unpkg.com/@popperjs/core@2.0.1"></script> | |
<script> | |
const popcorn = document.querySelector('#popcorn'); | |
const tooltip = document.querySelector('#tooltip'); | |
Popper.createPopper(popcorn, tooltip, { | |
placement: 'top', | |
modifiers: [ | |
{ | |
name: 'preventOverflow', | |
options: { | |
tether: false, | |
}, | |
}, | |
], | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment