Last active
April 5, 2016 16:53
-
-
Save wjt/f948c42babdd3284fd44eee38b2262c9 to your computer and use it in GitHub Desktop.
Reproducing HubSpot/drop#139
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
<html> | |
<head> | |
<link rel='stylesheet' href='css/drop-theme-basic.css'> | |
<script src='js/tether.js'></script> | |
<script src='js/drop.js'></script> | |
<script> | |
window.addEventListener('load', function onload() { | |
var b = document.querySelector('button'); | |
var drop; | |
function createDrop() { | |
drop = new Drop({ | |
target: b, | |
content: 'Welcome to the future!', | |
openOn: 'hover', | |
hoverOpenDelay: 1000, | |
}); | |
} | |
createDrop(); | |
b.addEventListener('click', function() { | |
drop.destroy(); | |
createDrop(); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<button>Hover over me, and click me within 1 second</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment