PDA

View Full Version : iFrame scroller



JonnyBoy333
02-08-2008, 06:10 AM
1) Script Title: iFrame Scroller

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/iframe-scroller.htm

3) Describe problem: So I'm pretty new at this, I have the frame in my page but I don't know where to put the external.htm file so that it will read it. I see that there's a place to specify the path to the external page but I'm not exactly sure what to put there. If someone had advice or could show me an example that would be awesome.

JonnyBoy333
02-08-2008, 06:42 AM
Nevermind, I figured it out. Also though, is there a way to make the scroller scroll slow then 1? I also wanted to know if there was a way to make the scroller either sit on the original text for a second before it starts scrolling each time or somehow make it start scrolling back in from the top like a wheel or something. Any thoughts?

ddadmin
02-08-2008, 07:31 AM
You can further slow down the scrolling of the IFRAME, apart from setting "scrollspeed" to 1, by changing the 40 value below in "external.htm" to a larger number:


setTimeout("scrollDiv()",40)

Change it to 80, for example.

Regarding setting a initial delay before the scroller starts scrolling, this is actually supported by default inside "external.htm":


//Specify intial delay before scroller starts scrolling (in miliseconds):
var initialdelay=500

Change 500 to 1000 for 1 second.

JonnyBoy333
02-11-2008, 09:06 PM
Cool, I got it to slow down a bit more but for the delay, I was hoping there would be the same delay every time it went back to the head. As it stands there is only a delay before the first rotation then it goes continuously.

ddadmin
02-12-2008, 05:08 AM
I assume you mean the initialdelay setting. Sure, to get it to apply whenever the scroller starts scrolling from the top again, try changing the below lines in external.htm:


if (parseInt(dataobj.style.top)<thelength*(-1))
dataobj.style.top="5px"
setTimeout("scrollDiv()",40)

to:


if (parseInt(dataobj.style.top)<thelength*(-1)){
dataobj.style.top="5px"
setTimeout("scrollDiv()", initialdelay)
}
else
setTimeout("scrollDiv()",40)

You'll also want to change the below line:


setTimeout("getdataheight()", initialdelay)

to just:


setTimeout("getdataheight()", 20)