<script type="text/javascript">
/* ==== slider nameSpace ==== */
var slider = function() {
/* ==== private methods ==== */
function getElementsByClass(object, tag, className) {
var o = object.getElementsByTagName(tag);
for ( var i = 0, n = o.length, ret = []; i < n; i++) {
if (o[i].className == className) ret.push(o[i]);
}
if (ret.length == 1) ret = ret[0];
return ret;
}
function setOpacity (obj,o) {
if (obj.filters) obj.filters.alpha.opacity = Math.round(o);
else obj.style.opacity = o / 100;
}
/* ==== Slider Constructor ==== */
function Slider(oCont, speed, iW, iH, oP) {
this.slides = [];
this.over = false;
this.S = this.S0 = speed;
this.iW = iW;
this.iH = iH;
this.oP = oP;
this.oc = document.getElementById(oCont);
this.frm = getElementsByClass(this.oc, 'div', 'slide');
this.NF = this.frm.length;
this.resize();
for (var i = 0; i < this.NF; i++) {
this.slides[i] = new Slide(this, i);
}
this.oc.parent = this;
this.view = this.slides[0];
this.Z = this.mx;
/* ==== on mouse out event ==== */
this.oc.onmouseout = function () {
this.parent.mouseout();
return false;
}
}
Slider.prototype = {
/* ==== animation loop ==== */
run : function () {
this.Z += this.over ? (this.mn - this.Z) * .5 : (this.mx - this.Z) * .5;
this.view.calc();
var i = this.NF;
while (i--) this.slides[i].move();
},
/* ==== resize ==== */
resize : function () {
this.wh = this.oc.clientWidth;//750
this.ht = this.oc.clientHeight;
详细解决方案
帮小弟我看看这段代码什么意思
热度:78 发布时间:2013-09-05 16:02:07.0
相关解决方案
- 在SQL话语里 这个符号“:”什么意思
- javascript中===什么意思?解决方法
- 麻烦帮小弟我看上这段SQL语句 什么意思
- 请教这里的@Override 什么意思 @符号有什么意思
- 请教,java源代码中 @Override、@Nullable 什么意思,小弟我从网下没搜到
- GetCurFocus()什么意思?该怎么解决
- .NET 4.0中总是看到 => 操作符,什么意思
- throw new Exception("Message.")什么意思?该如何处理
- 应用程序脱机~什么意思?不知道的帮顶~解决办法
- 未将对象引用设置到对象的实例 什么意思,该如何解决
- Context.Request.ApplicationPath 什么意思?马上结分解决方法
- 请教if (window.ActiveXObject) 什么意思
- Specified file '\Symbian\9.1\S60_3rd_MR\EPOC32\RELEASE\WINSCW\UDEB\.lib' not found 什么意思?解决方案
- matlab 中 ym1(ym1<一) = 1; xm1(xm1<1) = 1;什么意思
- VF中那个“类”什么意思,该如何解决
- vlan 配备中有一行 standby 101 ip 10.23.101.1 ,什么意思
- "Highest college grade completed"什么意思?解决办法
- "Highest college grade completed"什么意思?解决方案
- CheckBoxListener is not abstract......什么意思
- Collection<? extends E> c 什么意思?
- 新手求解 22行 this 什么意思
- [求助]请问这个(...)什么意思?
- 海明校验里 一个圆圈加个+ 什么意思
- int *p;printf("%p",p);什么意思,输出什么格式?
- 我在vc调试 c语言的广度优先遍历 出了一下这个警告 什么意思?
- scanf : floating point formats not linked,什么意思?
- [求助]exit(0)什么意思?
- 请大家看看最后那个printf("\'%c\'=%d ",i,c[i]);什么意思?谢谢
- 编译时,出的错误――问,什么意思?
- xmlhttp.onreadystatechange 什么意思?解决办法