Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<style type="text/css">
.marqueecontainer{
position: relative;
width: 200px; /*marquee width */
height: 200px; /*marquee height */
background-color: white;
border: 3px solid orange;
}
.marqueecontainer .slide{
width:200px;
left:0px;top:0px;
padding:0px;
}
.marqueecontainer .slide DIV{
width:190px; /*marquee width */
padding:5px;
}
</style>
<script type="text/javascript">
/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
Modified 30-October-2013
***********************************************/
function marqueescroll(o){
marqueePause(o.id);
o.psz=o.p[o.m[2]];
o.sz=-(o.l[o.m[1]]+o.l[o.m[2]]);
o.srt+=o.ss;
if ((o.ss<0&&o.srt>o.sz)||(o.ss>0&&o.srt<(o.w?-o.sz:o.psz))){
o.s.style[o.m[0]]=o.srt+'px';
}
else {
o.srt=(o.w?0:o.ss<0?o.psz:o.sz)+o.ss;
o.s.style[o.m[0]]=o.srt+'px';
}
o.to=setTimeout(function(){ marqueescroll(o); },30);
}
function marquee(o){
var id=o.ID,m=o.Mode,ss=o.Speed,i=o.StartIndex,srt=o.AutoDelay,p=document.getElementById(id),s=p?p.getElementsByTagName('DIV')[0]:null,clds=s?s.childNodes:[],ary=[],sz,l,z0=0;
if (s&&!marquee[id]){
var m=typeof(m)=='string'&&m.charAt(0).toUpperCase()=='H'?['left','offsetLeft','offsetWidth']:['top','offsetTop','offsetHeight'],sz=p[m[2]],slide=document.createElement('DIV'),c;
slide.style.position=s.style.position='absolute';
for (;z0<clds.length;z0++){
if (clds[z0].nodeType==1){
if (m[0]=='left'){
clds[z0].style.position='absolute';
clds[z0].style.left=sz*ary.length+'px';
clds[z0].style.top='0px';
}
ary.push([clds[z0],clds[z0][m[1]]]);
}
}
l=ary[ary.length-1][0];
o=marquee[id]={
l:l,
m:m,
id:id,
p:p,
sz:-(l[m[1]]+l[m[2]]),
psz:sz,
s:slide,
ss:typeof(ss)=='number'&&ss!=0?ss:-2,
w:o.Wrap!==false
}
o.s.appendChild(s);
c=s.cloneNode(true);
c.style.left=c.style.top='0px';
c.style[m[0]]=o.sz*(ss>0?1:-1)+'px';
o.w?o.s.appendChild(c):null;
o.srt=ary[i]?-ary[i][1]:0;
o.s.style.position='absolute';
o.s.style[m[0]]=o.srt+'px';
p.appendChild(o.s);
p.style.overflow='hidden';
typeof(srt)=='number'&&srt>1?marqueeAuto(id,srt):null;
}
}
function marqueeAuto(id,ms){
var o=marquee[id];
o?o.to=setTimeout(function(){ marqueescroll(o); },ms||200):null;
}
function marqueePause(id){
var o=marquee[id];
o?clearTimeout(o.to):null;
}
function marqueeInit(){
marquee({
ID:'marqueecontainer', // the unique ID name of the parent DIV. (string)
Mode:'vertical', // the display type, 'vertical' or 'horizontal' (string. defalut = 'vertical')
AutoDelay:2000, //(optional) the delay before starting scroll in milli seconds. (number, default = no auto scroll)
Speed:-2, //(optional) the scroll speed, < 0 = up. > 0 = down. (number, default = -2)
Wrap:true, //(optional) true = no gap, false = gap. (boolean, default = true)
StartIndex:Math.floor(Math.random()*4) //(optional) the index number of the element to start. (number, default = 0)
});
marquee({
ID:'marqueecontainer2', // the unique ID name of the parent DIV. (string)
Mode:'horizontal', // the display type, 'vertical' or 'horizontal' (string. defalut = 'vertical')
AutoDelay:2000, //(optional) the delay before starting scroll in milli seconds. (number, default = no auto scroll)
Speed:2, //(optional) the scroll speed, < 0 = up. > 0 = down. (number, default = -2)
StartIndex:0 //(optional) the index number of the element to start. (number, default = 0)
});
}
if (window.addEventListener)
window.addEventListener("load",marqueeInit,false);
else if (window.attachEvent)
window.attachEvent("onload",marqueeInit);
else if (document.getElementById);
window.onload=marqueeInit;
</script>
</head>
<body>
<div id="marqueecontainer" class="marqueecontainer" onMouseover="marqueePause('marqueecontainer');" onMouseout="marqueeAuto('marqueecontainer');">
<div class="slide">
<!--YOUR SCROLL CONTENT HERE-->
<div>
<b><a href="http://www.dynamicdrive.com/dynamicindex17/indexb.html">1 Iframe &
Ajax category added</a></b><br>
The Dynamic Content category has just been branched out with a new
<a href="http://www.dynamicdrive.com/dynamicindex17/indexb.html">sub category</a>
to better organize its scripts.
</div>
<div>
<b><a href="http://tools.dynamicdrive.com/gradient/">Gradient Image Maker</a></b><br>
We're excited to introduce our latest web tool- Gradient Image Maker!
</div>
<div>
<b><a href="http://www.dynamicdrive.com/forums/">DD Help Forum</a></b><br>
Check out our new forums for help on our scripts and coding in general.
</div>
<div align="left"><b><a href="http://www.dynamicdrive.com/notice.htm">Terms of
Usage update</a></b><br>
Please review our updated usage terms regarding putting our scripts in an
external .js file.
</div>
<!--YOUR SCROLL CONTENT HERE-->
</div>
</div>
<div id="marqueecontainer2" class="marqueecontainer" onMouseover="marqueePause('marqueecontainer2');" onMouseout="marqueeAuto('marqueecontainer2');">
<div class="slide">
<div>
<b><a href="http://www.dynamicdrive.com/dynamicindex17/indexb.html">Iframe &
Ajax category added</a></b><br>
The Dynamic Content category has just been branched out with a new
<a href="http://www.dynamicdrive.com/dynamicindex17/indexb.html">sub category</a>
to better organize its scripts.
</div>
<div>
<b><a href="http://tools.dynamicdrive.com/gradient/">Gradient Image Maker</a></b><br>
We're excited to introduce our latest web tool- Gradient Image Maker!
</div>
<div>
<b><a href="http://www.dynamicdrive.com/forums/">DD Help Forum</a></b><br>
Check out our new forums for help on our scripts and coding in general.
</div>
<div align="left"><b><a href="http://www.dynamicdrive.com/notice.htm">Terms of
Usage update</a></b><br>
Please review our updated usage terms regarding putting our scripts in an
external .js file.
</div>
</div>
</div>
</body>
</html>
Bookmarks