PDA

View Full Version : pausing message scrollers



sulla
01-10-2005, 10:48 PM
hi,

i was wondering why mike's dhtml scroller and the pausing message scroller, both in the scrollers section, do no work when using a strict doctype (HTML 4.01 Strict).
they both work fine when using transitional. i'm not very familiar with the specifics of doctypes, but is there a quick fix so i can still use one of these scroller scripts while maintaining a strict doctype?

thanks

ddadmin
01-11-2005, 01:27 AM
This is actually a known issue with older scripts in our archive, as DHTML needs slight modifications when it comes to positioning if your webpage has a strict doctype: http://www.dynamicdrive.com/doctype.htm Now, the entire Scroller's section has officially been scanned through and changes applied to handle doctype, though I recall a few scripts not being modified yet due to unforeseen problems. I suspect the two scripts you mentioned both fall into that category. Unfortunately there was a reason they were left out of the changes, and it may take a while before I can get back and reexamine them.

sulla
01-15-2005, 12:02 AM
pausing up down message scroller (http://www.dynamicdrive.com/dynamicindex2/crosstick.htm)

well the error was actually really simple, basically just a typo :)

in the else block of each move() function, just change the line:
tdiv.style.top=parseInt(scrollerheight);
to:
tdiv.style.top=scrollerheight;




function move3(whichdiv){
tdiv=eval(whichdiv)
if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
tdiv.style.top=0+"px"
setTimeout("move3(tdiv)",scrollerdelay)
setTimeout("move4(second2_obj)",scrollerdelay)
return
}
if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
setTimeout("move3(tdiv)",50)
}
else{
tdiv.style.top=scrollerheight //this line here was changed
tdiv.innerHTML=messages[i]
if (i==messages.length-1) i=0
else i++
}
}


how the most simple things can be the most annoying.