Skip to content

Instantly share code, notes, and snippets.

@wjt
Last active April 5, 2016 16:53
Show Gist options
  • Save wjt/f948c42babdd3284fd44eee38b2262c9 to your computer and use it in GitHub Desktop.
Save wjt/f948c42babdd3284fd44eee38b2262c9 to your computer and use it in GitHub Desktop.
Reproducing HubSpot/drop#139
<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