ProgramPotato Posted June 2, 2012 Share Posted June 2, 2012 Below is code I have for a slideshow: <div id="thepic" valign="center"><input type="image" src="ArrowLeft.png" value="<" onclick="move('down')" id="left"/><input type="image" src="ArrowRight.png" value=">" onclick="move('up')" id="right"/></div><input type="image" src="Stop.png" value="stop" onclick="pause()" id="stop" /><script type="text/javascript">var pics=["Placeholder.png", "Placeholder.png", "Placeholder.png", "Placeholder.png"];pics.unshift(pics.pop())function move(dir){if(timer){clearTimeout(timer)}if(dir=="down"){pics.unshift(pics.pop())} if(dir=="up"){pics.push(pics.shift()) }timer=setTimeout(function (){move(dir)}, 5000)document.getElementById("thepic").style.backgroundImage="url("+pics[0]+")";}var timer=setTimeout(function (){move("up")}, 5000) function pause(){clearTimeout(timer);}</script></div> I was wondering if there is a way to get a fading effect in between pictures, so it looks cleaner. What i really want is an effect like on iOS devices when you slide from picture to picture. I've seen both of these done before and I'd like to have this effect. Thanks! Link to comment Share on other sites More sharing options...
justsomeguy Posted June 4, 2012 Share Posted June 4, 2012 There should be several examples online using various methods. http://www.google.com/search?client=opera&rls=en&q=javascript+fade&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest Link to comment Share on other sites More sharing options...
ProgramPotato Posted June 5, 2012 Author Share Posted June 5, 2012 There should be several examples online using various methods. http://www.google.co...channel=suggest thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now