Created
October 17, 2020 21:30
-
-
Save nolanlawson/781e7084e4c17acb921357489d51a5b0 to your computer and use it in GitHub Desktop.
emoji-picker tooltip example
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>emoji-picker tooltip demo</title> | |
<style> | |
.tooltip:not(.shown) { | |
display: none; | |
} | |
</style> | |
</head> | |
<body> | |
<button onclick="toggle()">Click me</button> | |
<div class="tooltip" role="tooltip"> | |
<emoji-picker></emoji-picker> | |
</div> | |
<script src="https://unpkg.com/@popperjs/core@2"></script> | |
<script type="module" src="https://unpkg.com/emoji-picker-element@1"></script> | |
<script> | |
const button = document.querySelector('button') | |
const tooltip = document.querySelector('.tooltip') | |
Popper.createPopper(button, tooltip) | |
function toggle() { | |
tooltip.classList.toggle('shown') | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I gave a star to you to inspire you .Thanks for code.