JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!



slideshow in JS


S

keyboard_arrow_up
0
keyboard_arrow_down


First Post Mark as Spam safinewcoder
Posts: 1 - Registered: 2013-06-15 18:14:27

Hello,



Below code works fine for slide show. But I dont want the slide show to run once i come to the page. I want to see slide show start when i call it. How can I do it?



If I dont use callnow function, it works just fine. If I use the function, it does not work. It is stuck at car1 picture.


<script>
callnow();
function callnow(){var image1=new Image()
image1.src="car1.jpg"
var image2=new Image()
image2.src="car5.jpg"
var aa = '<img src=\"car1.jpg\" name=\"slide\" width="435" height="500"
/>';document.write(aa);



var step=1
function slideit(){
// var aa = '<img src=\"car1.jpg\" name=\"slide\" width="435" height="500"
/>';// document.write(aa);////if browser does not support the image
object, exit.
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step<2)
step++
else
step=1
//call function "slideit()" every 2.5 seconds
setTimeout("slideit()",2500)
}
slideit()
</script>






JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!




MENU
Advertising