Solved

Slow down a scrolling marquee in javascript....

Posted on 2008-10-21
3
1,480 Views
Last Modified: 2008-10-21
Hi, I have some parsed html I am palcing in a div, then applying Javascript to it to make it scroll - it was some free script i lifted off of the web.  The problem is, it looks like the speed can only be defined as a whole number - I have it set at "1" but it is still too fast - when I put in .75 or any fraction, it does not function - can anyone help with a solution?

Here is the script...

<script type="text/javascript">
var delayTime=5
var marqueeSpeed=1 //Here is where the problem is
var pauseTime=1
var copySpeed=marqueeSpeed
var pauseSpeed=(pauseTime==0)? copySpeed: 0
var actualHeight=''

function ScrollMarquee() {
  if (parseInt(crossMarquee.style.top)>((actualHeight / 2)*(-1)))
  crossMarquee.style.top=parseInt(crossMarquee.style.top)-copySpeed+"px"
  else
  crossMarquee.style.top=0 +"px"
}

function InitializeMarquee()
{
crossMarquee=document.getElementById("vmarquee")
crossMarquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualHeight=crossMarquee.offsetHeight;
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1)
{
crossMarquee.style.height=marqueeheight+"px"
crossMarquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("ScrollMarquee()",30)', delayTime)
}

if (window.addEventListener)
window.addEventListener("load", InitializeMarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", InitializeMarquee)
else if (document.getElementById)
window.onload=InitializeMarquee
etc...........


Thanks!!!
0
Comment
Question by:theclassic
  • 2
3 Comments
 
LVL 13

Expert Comment

by:crazyman
ID: 22768307
Increase delayTime
0
 
LVL 13

Accepted Solution

by:
crazyman earned 500 total points
ID: 22768322
sorry ignore that

try increasing this 30 which is the interval.
like...
setTimeout('lefttime=setInterval("ScrollMarquee()",100)', delayTime)
0
 

Author Comment

by:theclassic
ID: 22771686
Sorry - I know I accepted - but is there a way to make this scroll stop and fade - if it is something that is easy, you can answer - if not I can post again - Thanks for your help!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access Web appliction 7 47
Excel import error " External table is not in expected format" 12 48
SQL Login 17 38
Web Form VB.Net  import CSV 4 21
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now