Code:
<html>
<head>
<style type="text/css">
/*<![CDATA[*/
#datacontainer {
position:absolute;left:1px;top:10px;width:600px; /*the width of the target page parent IFRAME */
}
.scroll {
position:absolute;left:1px;top:10px;width:3000px;
}
.item {
width:200px;float:left; /* do not use margin-Right */
}
/*]]>*/
</style>
<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; // > 0 = scroll left, < 0 = scroll right
//Specify intial delay before scroller starts scrolling (in miliseconds):
var initialdelay=500;
function initializeScroller(){
var obj=document.getElementById("datacontainer"),slide=obj.getElementsByTagName('DIV')[0],clds=slide.childNodes,lst=clds[clds.length-1],lst=lst.nodeType==1?lst:lst.previousSibling,sz=lst.offsetLeft+lst.offsetWidth,nu=Math.ceil(obj.offsetWidth/sz)+1,z0=0;
for (;z0<nu;z0++){
slide=z0>0?slide.cloneNode(true):slide;
slide.style.left=sz*z0+'px';
obj.appendChild(slide);
}
setTimeout(function(){ Scroll(0,sz); }, initialdelay);
}
function Scroll(lft,sz){
lft-=scrollspeed;
if ((scrollspeed>0&&lft<-sz)||(scrollspeed<0&&lft>0)){
lft=(scrollspeed>0?0:-sz)-scrollspeed;
}
document.getElementById("datacontainer").style.left=lft+'px'
setTimeout(function(){ Scroll(lft,sz); }, 40);
}
if (window.addEventListener)
window.addEventListener("load", initializeScroller, false)
else if (window.attachEvent)
window.attachEvent("onload", initializeScroller)
else
window.onload=initializeScroller
</script>
</head>
<body>
<div id="datacontainer" onMouseover="scrollspeed=0" onMouseout="scrollspeed=cache">
<div class="scroll" >
<!-- ADD YOUR SCROLLER CONTENT INSIDE HERE -->
<div class="item" >
<b>What's Hot</b></p>
</div>
<div class="item" >
<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>
</div>
<div class="item" >
<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>
</div>
<div class="item" >
<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>
</div>
<div class="item" >
<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>
</div>
<!-- END SCROLLER CONTENT -->
</div>
</div>
</body>
</html>
Bookmarks