Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
scrolling message help!
Old 03-28-2006, 09:55 AM scrolling message help!
Novice Talker

Posts: 5
Trades: 0
i have an html page displaying stocks values. an input for writing the stock symbol and a button search for getting the stock value from database. And on top of the form a scroll message dispaying top 5 stock values.

Now when i hit the button search several times, an undefined message text is displayed then after some time, the scroll message works good again.

here is the scroll script that i used. So why is that? any solution

var scrollerdelay='1'
var scrollerwidth='600px'
var scrollerheight='74px'
var scrollerbgcolor=''
//set below to '' if you don't wish to use a background image
var scrollerbackground=''
//configure the below variable to change the contents of the scroller
var scrollingMessages=new Array()
var time;
///////Do not edit pass this line///////////////////////
var ie=document.all
var dom=document.getElementById
if (scrollingMessages.length>2)
i=2
else
i=0
function move(whichdiv)
{
tdiv=eval(whichdiv)

if (tdiv.innerHTML == 'undefined')
{
tdiv.innerHTML ='';
time = setTimeout("move2(second2_obj)",scrollerdelay)
return;
}
if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.t op)<=5)
{
tdiv.style.top=0+"px"
time = setTimeout("move(tdiv)",scrollerdelay)
time = setTimeout("move2(second2_obj)",scrollerdelay)
return
}

if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1)
{
tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
time = setTimeout("move(tdiv)",50)
}
else
{
tdiv.style.top=parseInt(scrollerheight)+"px"
tdiv.innerHTML=scrollingMessages[i]

if (i==scrollingMessages.length-1)
i=0
else
i++
}
}
function move2(whichdiv)
{
tdiv2=eval(whichdiv)

if (tdiv2.innerHTML == 'undefined')
{
tdiv2.innerHTML ='';
time = setTimeout("move2(first2_obj)",scrollerdelay)
return;
}
if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style .top)<=5)
{
tdiv2.style.top=0+"px"
time = setTimeout("move2(tdiv2)",scrollerdelay)
time = setTimeout("move(first2_obj)",scrollerdelay)
scrollerdelay='7000';
return
}
if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1)
{
tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
time = setTimeout("move2(second2_obj)",50)
}
else
{
tdiv2.style.top=parseInt(scrollerheight)+"px"
tdiv2.innerHTML=scrollingMessages[i]

if (i==scrollingMessages.length-1)
i=0
else
i++
}
}
function startscroll()
{
first2_obj=ie? first2 : document.getElementById("first2");
second2_obj=ie? second2 : document.getElementById("second2");
move(first2_obj);
second2_obj.style.top=scrollerheight;
second2_obj.style.visibility='visible';
}
function stopscroll()
{
if (time) clearTimeout(time);

}
mariechristine is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-29-2006, 06:27 AM Re: scrolling message help!
Novice Talker

Posts: 5
Trades: 0
help! help! help!
mariechristine is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to scrolling message help!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26734 seconds with 12 queries