perezf Posted August 26, 2008 Share Posted August 26, 2008 I have a javascript marquee, that i want it to go slower than the 1 minium it allows me. Can anyone help? <script type="text/javascript"> /*********************************************** * Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit http://www.dynamicdrive.com/ for this script and 100s more. ***********************************************/ var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds) var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10) var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)? ////NO NEED TO EDIT BELOW THIS LINE//////////// var copyspeed=marqueespeed var pausespeed=(pauseit==0)? copyspeed: 0 var actualheight='' function scrollmarquee(){ if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+) //if scroller hasn't reached the end of its height cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px" //move scroller upwards else //else, reset to original position cross_marquee.style.top=parseInt(marqueeheight)+8+"px" } function initializemarquee(){ cross_marquee=document.getElementById("vmarquee") cross_marquee.style.top=0 marqueeheight=document.getElementById("marqueecontainer").offsetHeight actualheight=cross_marquee.offsetHeight //height of marquee content (much of which is hidden from view) if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit cross_marquee.style.height=marqueeheight+"px" cross_marquee.style.overflow="scroll" return } setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll) } if (window.addEventListener) window.addEventListener("load", initializemarquee, false) else if (window.attachEvent) window.attachEvent("onload", initializemarquee) else if (document.getElementById) window.onload=initializemarquee </script> Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted August 26, 2008 Share Posted August 26, 2008 Change the delayb4scroll to something greater than 2000. Quote Link to comment Share on other sites More sharing options...
perezf Posted August 27, 2008 Author Share Posted August 27, 2008 That would only affect the start of the script Right now it is set to 2 seconds, so that means that the script wont start scrolling until the 2 seconds have been reached. I need to know how i can slow down the actual scroll This Part var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10) 1 is the lowest it will go so i want to know how i can manipulate the script to make it go slower. Quote Link to comment Share on other sites More sharing options...
obsidian Posted August 27, 2008 Share Posted August 27, 2008 This is the line of the script that actually calls the movement function: setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll) The 30 is the number of milliseconds between the animation calls. You need to increase the number of milliseconds to slow it down. Bump it up to 100, 200, etc until you get the desired effect. Quote Link to comment Share on other sites More sharing options...
adam84 Posted August 27, 2008 Share Posted August 27, 2008 Maybe sleep/wait function....? Quote Link to comment 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.