<!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 ">
<Kopf>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<Körper>
<script type="text/javascript">
var $ = Funktion (id) {
return „string“ == typeof id ? document.getElementById(id) : id;
};
var-Klasse = {
erstellen: function() {
Rückgabefunktion() {
this.initialize.apply(this, arguments);
}
}
}
Object.extend = function(destination, source) {
für (var Eigenschaft in Quelle) {
Ziel[Eigenschaft] = Quelle[Eigenschaft];
}
Rückreiseziel;
}
Funktion addEventHandler(oTarget, sEventType, fnHandler) {
if (oTarget.addEventListener) {
oTarget.addEventListener(sEventType, fnHandler, false);
} else if (oTarget.attachEvent) {
oTarget.attachEvent("on" + sEventType, fnHandler);
} anders {
oTarget["on" + sEventType] = fnHandler;
}
};
var Scroller = Class.create();
Scroller.prototype = {
initialisieren: function(idScroller, idScrollMid, Optionen) {
var oscroll = this, Oscroller = $ (idScroller), Oscrollmid = $ (idScrollmid);
this.heightScroller = Oscroller.Offseteight;
this.heightList = oScrollMid.offsetHeight;
if (this.heightList <= this.heightScroller) return;
Oscroller.Style.Overflow = "Hidden";
oScrollMid.appendChild(oScrollMid.cloneNode(true));
this.Oscroller = oscroller;
this.timer = null;
this.SetOptions(options);
this.side = 1; // 1 是上 -1 是下
Switch (this.options.side) {
Fall „unten“:
this.side = -1;
brechen;
Fall „oben“:
Standard :
this.side = 1;
}
addEventHandler (Oscrollmid, "mouseover", function () {oscroll.stop ();});
addEventHandler (Oscrollmid, "Mouseout", function () {oscroll.start ();});
if(this.options.PauseStep <= 0 || this.options.PauseHeight <= 0) this.options.PauseStep = this.options.PauseHeight = 0;
this.pause = 0;
this.Start();
},
//设置默认属性
SetOptions: Funktion(Optionen) {
this.options = {//默认值
Schritt: 1, // 每次变化的 px 量
Zeit: 20, // 速度 (越大越慢)
Seite: „up“,//滚动方向: „up“ wird angezeigt, „down“ wird angezeigt
PauseHeight: 0, // 隔多高停一次
PauseStep: 1000//停顿时间(PauseHeight大于0该参数才有效)
};
Object.extend(this.options, Optionen || {});
},
// 滚动
Scrollen: function () {
var iscroll = this.Oscroller.scrolltop, iHeight = this.heightList, time = this.options.time, oscroll = this, isTep = this.options.Step * this.side;
if(this.side > 0){
if(iScroll >= (iHeight * 2 - this.heightScroller)){ iScroll -= iHeight; }
} anders {
if (iscroll <= 0) {iscroll += iHeight; }
}
if (this.options.pauseHeight> 0) {
if (this.pause> = this.options.pauseHeight) {
time = this.options.pausstep;
this.pause = 0;
} anders {
this.Pause += Math.abs(iStep);
this.oScroller.scrolltop = iscroll + iStep;
}
} else {this.oscroller.scrolltop = iscroll + iStep; }
this.timer = window.settimeout (function () {oscroll.scroll ();}, Zeit);
},
//开始
Start: function () {
this.scroll ();
},
//停止
Stopp: function() {
clearTimeout(this.timer);
}
};
window.onload = function(){
New Scroller ("idScroller", "idScrollMid", {pauseHeight: 25});
}
</script>
<Stil>
#IdScroller *{Margin: 0px; padding:0px;}
#IdScroller {Zeilenhöhe: 25px; Breite: 100%; Höhe: 25px; Überlauf:versteckt; Grenze: 1PX Solid #000000;}
#IDSCROLLER UL {Breite: 100%}
#IdScroller li {Breite: 20%; float:left; Überlauf:versteckt; Listenstil: Keine;}
</style>
<div id = "idScroller">
<div id = "idScrollmid">
<ul>
<li> <a href = "http://www.devdao.com/">www.devdao.com </a> </li> >
<li> <a href = "http://www.devdao.com/">www.devdao.com </a> </li> >
<li> <a href = "http://www.devdao.com/">www.devdao.com </a> </li> >
<li> <a href = "http://www.devdao.com/">www.devdao.com </a> </li> >
<li> <a href = "http://www.devdao.com/">www.devdao.com </a> </li> >
<li> <a href = "http://www.devdao.com/">www.devdao.com </a> </li> >
</ul>
<div style = "klare: beides;"> </div>
</div>
</div>
</body>
</html>