Jump to content

Javascript Scrolling Img Bar


drewp-drew

Recommended Posts

Here's the script, just want to get the 'white-horse.jpg' moving the same as the other 2.....URL: http://www.designer-drew.com

<script>/////////////////////www.fortochka.com//Alexander Babichev 2006 Coopyright//This script is free for private use. Otherwise a $10 fee per a site is required.//the script can be modified but the copyright notice should be left unchanged.///////////////////var pic = new Array()function banner(name, width, link){this.name = namethis.width = widththis.link = link}pic[0] = new banner('portfolio/designer.jpg',102,'http://www.designer-drew.com')pic[1] = new banner('portfolio/webofhope.jpg',102,'http://www.thewebofhope.com')pic[2] = new banner('portfolio/white-horse.jpg',102,'http://www.whitehorsefalconry.co.uk')var speed = 50var kk = pic.lengthvar iivar hhhvar nnnvar myIntervalvar myPausevar mode = 0var imgArray = new Array(kk)var myLeft = new Array(kk)for (ii=0;ii<kk;ii++){imgArray[ii] = new Image()imgArray[ii].src = pic[ii].nameimgArray[ii].width = pic[ii].widthhhh=0 for (nnn=0;nnn<ii;nnn++){hhh=hhh+pic[nnn].width}myLeft[ii] = hhh}function ready(){for (ii=0;ii<kk;ii++){ if (document.images[ii].complete == false){return false break}}return true}function startScrolling(){if (ready() == true){ window.clearInterval(myPause)myInterval = setInterval("autoScroll()",speed) }} function autoScroll(){for (ii=0;ii<kk;ii++){myLeft[ii] = myLeft[ii] - 1if (myLeft[ii] == -(pic[ii].width)){hhh = 0for (nnn=0;nnn<kk;nnn++){if (nnn!=ii){hhh = hhh + pic[nnn].width} }myLeft[ii] = hhh}document.images[ii].style.left = myLeft[ii]}mode = 1}function stop(){if (mode == 1){window.clearInterval(myInterval)}if (mode == 0){window.clearInterval(myPause)} }function go(){if (mode == 1){myInterval = setInterval("autoScroll()",speed)}if (mode == 0){myPause = setInterval("startScrolling()",3000)} }myPause = setInterval("startScrolling()",3000)</Script><script>for (ii=0;ii<kk;ii++){document.write('<a href = ' + pic[ii].link + ' target="_blank" ><img space=0 hspace=0 vspace=0 border=0 height=74 style=position:absolute;top:0;left:' + myLeft[ii] + '; src=' + pic[ii].name + ' onMouseOver=stop() onMouseOut=go()></a>')}</Script>

thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...