Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting iscroller to loop

Status
Not open for further replies.

rrmcguire

Programmer
Oct 13, 2010
304
0
0
US
Hello,

within my page at I have a script which was found through dynamicdrive for a scrolling news section:

<script type="text/javascript">

/***********************************************
* IFRAME Scroller script- © Dynamic Drive DHTML code library (* This notice MUST stay intact for legal use
* Visit Dynamic Drive at for full source code
***********************************************/

//specify path to your external page:
var iframesrc="external.htm"

//You may change most attributes of iframe tag below, such as width and height:
document.write('<iframe id="datamain" src="'+iframesrc+'" width="400px" height="300px" marginwidth="0" marginheight="0" hspace="5" vspace="5" frameborder="1" scrolling="no"></iframe>')
</script>

The script calls this page external.htm

<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>Meadow Lark Customer Referrals</b>
<p align="left"><strong><font face="Verdana"><small><a href="" target="_blank">Hanson Heidelberg Cement Group</a>&nbsp;</small></font></strong><br>
<font face="Verdana"><small>Not Long ago Hanson Pressure Pipe entered into a contractual relationship.......
</small></font></p>
<p align="left"><strong><font face="Verdana"><small><a href="" target="_top">Alstom Power</a>&nbsp;</small></font></strong><br>
<font face="Verdana"><small>Your rapid growth within our company is due to your strengths......
</small></font></p>
<p align="left"><small><strong><font face="Verdana"><a href="" target="_top">FMC Technologies</a>&nbsp;</font></strong></small><br>
<small><font face="Verdana">We find their staff to be super responsive...</font></small></p>
<p align="left"><font face="Verdana"><strong><a href="" target="_top"><small>Komatsu Equipment</small></a><br>
</strong><small>Meadow Lark Transportation has been a wonderful company to work with.....</small></font>
<p align="left"><small><strong><font face="Verdana"><a href="" target="_top">Cummins Rocky Mountain LLC</a>&nbsp;</font></strong></small><br>
<small><font face="Verdana">Just a quick note to express my company's attitude regarding this claim. Specifically, I want to thank you....</font></small>
<p align="left"><font face="Verdana"><strong><a href="" target="_top"><small>Hydro Power Services</small></a><br>
</strong><small>This letter is to substantiate the extraordinary relationship.....</small></font>
<p align="left"><font face="Verdana"><strong><a href="" target="_top"><small>Manitowoc</small></a><br>
</strong><small>Kysor Panel Systems has found a greate carrier partner......</small></font></p>

<!-- END SCROLLER CONTENT -->

</div>

<script type="text/javascript">

/***********************************************
* IFRAME Scroller script- © Dynamic Drive DHTML code library (* This notice MUST stay intact for legal use
* Visit Dynamic Drive at for full source code
***********************************************/

//Specify speed of scroll. Larger=faster (ie: 5)
var scrollspeed=cache=1

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

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()",40)
}

if (window.addEventListener)
window.addEventListener("load", initializeScroller, false)
else if (window.attachEvent)
window.attachEvent("onload", initializeScroller)
else
window.onload=initializeScroller

</script>

</body>
</html>



My question is how can I make this so that the scrolling loops rather than pauses after my last <p> element, so its continuous.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top