Last active
December 24, 2015 13:09
-
-
Save featherart/6802486 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
<html> | |
<head> | |
<title>Supersize Me Cookie</title> | |
</head> | |
<body> | |
<button href="#" onclick="myStopFunction();">stop the cookie!</button> | |
<br> | |
<img name="fred" id="freddie" src="cookie.jpg" width="100" height="auto"> | |
<script type="text/javascript"> | |
window.onload = function() { | |
var myImage = document.images["fred"]; | |
myImage.height = 100; | |
myImage.width = 100; | |
function makeBig() { | |
//myImage.height = myImage.height + 5; | |
//myImage.width = myImage.width + 5; | |
myImage.width *= 1.1; | |
myImage.height *= 1.1; | |
} | |
var myVar=setInterval(function(){ makeBig() },500); | |
window.myStopFunction = function() { | |
window.clearInterval(myVar); | |
} | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment