I am looking for some ideas on how to get the scroller to reset to the top of the external document AND have the initialdelay work. Currently the script allows for the initial delay on the first run through only.
Thanks
I am looking for some ideas on how to get the scroller to reset to the top of the external document AND have the initialdelay work. Currently the script allows for the initial delay on the first run through only.
Thanks
Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format for asking a question.
That being said, the solution here, if I understand you, is to change this:to this:Code:function scrollDiv(){ dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px" if (parseInt(dataobj.style.top)<thelength*(-1)) dataobj.style.top="5px" setTimeout("scrollDiv()",40) }Enjoy!Code:function scrollDiv(){ dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px" if (parseInt(dataobj.style.top)<thelength*(-1)){ dataobj.style.top="5px" setTimeout("scrollDiv()", initialdelay) } else setTimeout("scrollDiv()",40) }
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Thanks....didn't seem to work so I likely have not explained well enough. Here's the link to the external.htm file where the script is found. I am looking to have the scroll delay (based on the initialdelay variable) EACH time it is going to scroll through.
http://www.dynamicdrive.com/dynamicindex2/external.htm
Thanks for your help.
Worked here. I'll paste in the whole file. It is set to 5 second initial delay. It will pause for 5 seconds before each run through.
HTML Code:<!-- External.htm source--> <html> <body> <div id="datacontainer" style="position:absolute;left:1px;top:10px;width:100%" onMouseover="scrollspeed=0" onMouseout="scrollspeed=cache"> <!-- ADD YOUR SCROLLER CONTENT INSIDE HERE --> <b>What's Hot</b></p> <p align="left"><strong><font face="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex9/encrypter.htm" target="_top">Source code encrypter</a> </small></font></strong><br> <font face="Verdana" size="2">Scramble the source of any chunk of code using this unique script.</font></p> <p align="left"><strong><font face="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex5/flashlink.htm" target="_top">Flashing links</a> </small></font></strong><br> <font face="Verdana"><small>Bring attention to special links, by making them flash!</small></font></p> <p align="left"><small><strong><font face="Verdana"><a href="http://www.dynamicdrive.com/dynamicindex13/roamcursor.htm" target="_top">Roaming Cursor</a> </font></strong></small><br> <small><font face="Verdana">Display a second, "roaming" cursor on your page with this fun animation script.</font></small></p> <p align="left"><font face="Verdana"><strong><a href="http://www.dynamicdrive.com/dynamicindex11/animatedtitle.htm" target="_top"><small>Animated Document title</small></a><br> </strong><small>Animate into view your document's title!</small></font> <!-- END SCROLLER CONTENT --> </div> <script type="text/javascript"> /*********************************************** * IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code ***********************************************/ //Specify speed of scroll. Larger=faster (ie: 5) var scrollspeed=cache=2 //Specify intial delay before scroller starts scrolling (in miliseconds): var initialdelay=5000 function initializeScroller(){ dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer") dataobj.style.top="5px" setTimeout("getdataheight()", initialdelay) } function getdataheight(){ thelength=dataobj.offsetHeight if (thelength==0) setTimeout("getdataheight()",10) else scrollDiv() } function scrollDiv(){ dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px" if (parseInt(dataobj.style.top)<thelength*(-1)){ dataobj.style.top="5px" setTimeout("scrollDiv()", initialdelay) } else setTimeout("scrollDiv()",40) } if (window.addEventListener) window.addEventListener("load", initializeScroller, false) else if (window.attachEvent) window.attachEvent("onload", initializeScroller) else window.onload=initializeScroller </script> </body> </html>
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Got it....thanks!
Hi! I'm not sure if this is the same problem as I am having, but what I am getting is the external file reloading once the scroller has come to the end of the file and what I would like to happen is for the file to just scroll back up again rather than just jumping back into position. Is this possible?
http://www.spoonofmilk.com/arcproduction/ is the place I am using the script
Thanks!
I think I see what you are after, the scroller jumps to the top but, you would rather it slide in from the bottom. To get that effect, you can change the top restart position (default of 5px) hard coded into the scrollDiv() function on the external page to be about the height of your iframe on the container page (looked like about 250px to me). In plain English, find this function on latest.html:
Change it to this:Code:function scrollDiv(){ dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px" if (parseInt(dataobj.style.top)<thelength*(-1)) dataobj.style.top="5px" setTimeout("scrollDiv()",40) }
Code:function scrollDiv(){ dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px" if (parseInt(dataobj.style.top)<thelength*(-1)) dataobj.style.top="255px" setTimeout("scrollDiv()",40) }
Last edited by jscheuer1; 03-31-2006 at 03:40 AM.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
ahhh wicked! much thanks!
Bookmarks