View Full Version : iFRAME Scroller
Prescotian
02-07-2008, 08:37 PM
1) Script Title: iFRAME SCROLLER
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/iframe-scroller.htm
3) Describe problem: Why does it stop scrolling?
I put this into my webpage and it works fien witht he external.htm file suppiled but as soon as I start to edit external.hmt... it stops scrolling... I am not removing any html/javascript in external.htm.... please help because this scroller fits my bill perfectly!
thetestingsite
02-07-2008, 08:53 PM
Please post a link to the page on your site that contains the problematic script so we can check it out.
Prescotian
02-07-2008, 09:14 PM
Please post a link to the page on your site that contains the problematic script so we can check it out.
http://www.somelad.co.uk/basecopy.htm
thetestingsite
02-07-2008, 09:41 PM
In your external.htm page, you need to place all of your contents within a div tag with the id of datacontainer. In short, your code should look like this (the highlighted parts are what I added):
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title></title>
</head>
<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 -->
<p><b>What's Hot</b></p>
<p><a href="http://www.siderodoromania.com"><b>Visit the railway
site with real umph</b></a><b><br>
</b>Siderodoromania, the obsession with steam locomotives site</p>
<p><a href="http://www.somelad.co.uk"><strong>Some Lad</strong></a><strong><br>
My own personal site</strong></p>
<p align="left"><a
href="http://www.dynamicdrive.com/dynamicindex9/encrypter.htm"
target="_top"><font size="2" face="Verdana"><strong>Source code
encrypter</strong></font></a><font size="2" face="Verdana"><strong> </strong></font><br>
<font size="2" face="Verdana">Scramble the source of any chunk of
code using this unique script.</font></p>
<p align="left"><a href="http://www.toffeeweb.com"><strong>Evertonians
at Toffeeweb</strong></a><strong><br>
</strong>COYB</p>
<p align="left"><a
href="http://www.dynamicdrive.com/dynamicindex13/roamcursor.htm"
target="_top"><font size="2" face="Verdana"><strong>Roaming
Cursor</strong></font></a><font size="2" face="Verdana"><strong> </strong></font><br>
<font size="2" face="Verdana">Display a second,
"roaming" cursor on your page with this fun animation
script.</font></p>
<p align="left"><a
href="http://www.dynamicdrive.com/dynamicindex11/animatedtitle.htm"
target="_top"><font size="2" face="Verdana"><strong>Animated
Document title</strong></font></a><strong><br>
</strong><font size="2">Animate into view your document's title!</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=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> </p>
</body>
</html>
Hope this helps.
Prescotian
02-10-2008, 04:54 PM
Brilliant... thanks very much.. all up and running now!
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.