Created
December 2, 2016 02:24
-
-
Save cvan/2a0ed2bcbf73900d43798431283f9e1e 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
<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