Pausing a script using onMouseOver

topic posted Thu, June 22, 2006 - 9:49 AM by  Claudia
I have a rotating banner script which is very neat and handles 3 linked banners ... but what I want to do is be able to pause the cycle by rolling over another series of images ... www.scabal.net ... (the list of text should stop the slide-show, and secondly it would be super if it stops it in the right place - but just to pause the slideshow would be enough at the moment.) Having used several other scripts, that were quite cumbersome, I would like to stick with the script that I have got and just add to it.

The code is like this...

<script language="Javascript" type="text/javascript">
<!-- Hide script from old browsers

adImages1 = new Array("boxes/index/indindex.gif","boxes/index/commrindex.gif",
"boxes/index/resindex.gif","boxes/index/eduindex.gif","boxes/index/commuindex.gif", "boxes/index/medindex.gif")
adImages2 = new Array("boxes/index/jubilee01.jpg","boxes/index/voda01.jpg",
"boxes/index/trumans01.jpg","boxes/index/chingford01.jpg","boxes/index/reina01.jpg","boxes/index/medical01.jpg")
adImages3 = new Array("boxes/index/inditext.gif","boxes/index/commrtext.gif",
"boxes/index/restext.gif","boxes/index/edutext.gif","boxes/index/commutext.gif","boxes/index/medtext.gif")
adURL = new Array("scabalindustrial.html","scabalcommercial02.html",
"scabalresidential.html","scabaleducation.html","scabalcommunity.html","scabalmedical.html")

thisAd1 = 0
thisAd2 = 0
thisAd3 = 0
imgCt1 = adImages1.length
imgCt2 = adImages2.length
imgCt3 = adImages3.length

function rotate() {
if (document.images) {
thisAd1++
if (thisAd1 == imgCt1) {
thisAd1 = 0
}
document.adBanner1.src=adImages1[thisAd1]

thisAd2++
if (thisAd2 == imgCt2) {
thisAd2 = 0
}
document.adBanner2.src=adImages2[thisAd2]

thisAd3++
if (thisAd3 == imgCt3) {
thisAd3 = 0
}
document.adBanner3.src=adImages3[thisAd3]

setTimeout("rotate()", 3 * 1000)
}

}


function newLocation() {
document.location.href = "www.scabal.net/" + adURL[thisAd1]
document.location.href = "www.scabal.net/" + adURL[thisAd2]
document.location.href = "www.scabal.net/" + adURL[thisAd3]
}


// End hiding script from old browsers -->
</script>

Then I have an onload="rotate()" in the body tag... and so on and so on to run the slideshow.

Any ideas would be gratefully received!

regards

Claudia
posted by:
Claudia
London