Skip to content

Instantly share code, notes, and snippets.

@cvan
Created December 2, 2016 02:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cvan/2a0ed2bcbf73900d43798431283f9e1e to your computer and use it in GitHub Desktop.
Save cvan/2a0ed2bcbf73900d43798431283f9e1e to your computer and use it in GitHub Desktop.
<script>
var svgLogo = document.querySelector('#WebVR_Logo');
setTimeout(function () {
pause();
}, 6999);
function play () {
console.log('play');
svgLogo.unpauseAnimations(); // resumes ALL animations
}
function pause () {
console.log('pause');
svgLogo.pauseAnimations(); // pause ALL animations
}
svgLogo.addEventListener('mouseenter', function () {
console.log('mouseenter');
});
svgLogo.addEventListener('mouseleave', function () {
console.log('mouseleave');
pause();
});
svgLogo.addEventListener('click', function () {
play();
setTimeout(function () {
pause();
}, 6999);
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment