Last active
August 29, 2015 14:01
-
-
Save mralext20/2cbc37b6c5704a4c5d05 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> | |
<script> | |
var currphoto; | |
var play; | |
currphoto = '1'; | |
function next(){ | |
if(currphoto==33){ | |
currphoto=1} | |
else{ | |
currphoto++} | |
document.getElementById("gallery").innerHTML = '<img height=300px src="assets/' + currphoto + '.jpg">'; | |
document.getElementById("num").innerHTML = 'photo number'+" " + currphoto | |
} | |
function last(){ | |
if(currphoto==1){ | |
currphoto=33} | |
else{ | |
currphoto--} | |
document.getElementById("gallery").innerHTML = '<img height=300px src="assets/' + currphoto + '.jpg">' | |
document.getElementById("num").innerHTML = 'photo number'+" " + currphoto; | |
} | |
var timer | |
</script> | |
</head> | |
<body> | |
<div id="gallery"><img height=300px src="assets/1.jpg"></div> | |
<center><button onclick="next()">next</button><div id=num>photo number 1</div><button onclick="last()">last</button><button onclick="timer = setInterval(function(){next()}, 1000); ">play</button><button onclick="clearInterval(timer);">pause</button></center> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment