Jaswinder Posted March 30, 2013 Share Posted March 30, 2013 i want the images to change automatically in a div... i am not able to complete the code.. or dont know doing it correct or not i am using following script <script>var a=new array("1.jpg","2.jpg","3.jpg")var i=0function show(){ document.getElementById("snap").src=a i++; if(i>2) {i=0}}setInterval("show()",1000)</script> <body><div style="height:500px; width:500px;" id="snap"></div> Quote Link to comment https://forums.phpfreaks.com/topic/276322-changing-the-images-in-a-div-automatically/ Share on other sites More sharing options...
haku Posted March 31, 2013 Share Posted March 31, 2013 You didn't tell us what you are trying to do, or what is happening now. Quote Link to comment https://forums.phpfreaks.com/topic/276322-changing-the-images-in-a-div-automatically/#findComment-1422039 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.