PDA

View Full Version : IFRAME Scroller



annasue
04-27-2007, 08:05 PM
I have this code installed at www.allneedzrental.com/new and the text from the file is appearing but won't scroll??? All I changed in the code was the name of the external file.

Also, how do you change the font colors, etc.?

Thanks in advance.

jscheuer1
04-27-2007, 08:12 PM
That's your problem then. You need to use the supplied external.htm. You can edit its content to your own but, the layout, page code, and script on it are required.

annasue
04-27-2007, 08:26 PM
I changed the name of the file to update.htm and I'll attach it. I'm not sure what you mean by "the layout, page code, and script on it are required."???

jscheuer1
04-27-2007, 08:41 PM
Here is your update.htm:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="file:///C|/1PAGES/Murray%20Wilton%20Ministries/default.css" rel="stylesheet" type="text/css">
</head>

<body>
<p align="center" class="content">Please visit Panoply this weekend to see all
the outstanding tents we have put there for you to enjoy.</p>
<p align="center" class="content">All Needz Rental stands ready to provide all
your Rental Products for your upcoming Wedding.</p>
</body>
</html>

It is just an ordinary page, here is the external.htm that you should use:


<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>&nbsp;</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>&nbsp;</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>&nbsp;</font></strong></small><br>
<small><font face="Verdana">Display a second, &quot;roaming&quot; 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=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>


See the difference? You can change its name and edit its content but, the rest must remain 'as is'.

annasue
04-27-2007, 08:56 PM
Thanks so much, I get it now! What confused me was I used another of DD's scrollers and didn't have to have all that code around the include file.

I appreciate it - it's working now.