主题 : 关于滚动资讯 |
级别: 举人
|
1# 发表于:2015-11-11 14:32:53 IP:106.220.*.*
|
||||
---|---|---|---|---|---|
级别: 举人
|
5# 发表于:2015-11-11 14:40:15 IP:106.220.*.*
回复第4楼Cms.UpRoller = function(rid, speed, isSleep, sleepTime, rollRows, rollSpan,
unitHight) { this.speed = speed; this.rid = rid; this.isSleep = isSleep; this.sleepTime = sleepTime; this.rollRows = rollRows; this.rollSpan = rollSpan; this.unitHight = unitHight; this.proll = $('#roll-' + rid); this.prollOrig = $('#roll-orig-' + rid); this.prollCopy = $('#roll-copy-' + rid); // this.prollLine = $('#p-roll-line-'+rid); this.sleepCount = 0; this.prollCopy[0].innerHTML = this.prollOrig[0].innerHTML; var o = this; this.pevent = setInterval(function() { o.roll.call(o) }, this.speed); } Cms.UpRoller.prototype.roll = function() { if (this.proll[0].scrollTop > this.prollCopy[0].offsetHeight) { this.proll[0].scrollTop = this.rollSpan + 1; } else { if (this.proll[0].scrollTop % (this.unitHight * this.rollRows) == 0 && this.sleepCount <= this.sleepTime && this.isSleep) { this.sleepCount++; if (this.sleepCount >= this.sleepTime) { this.sleepCount = 0; this.proll[0].scrollTop += this.rollSpan; } } else { var modCount = (this.proll[0].scrollTop + this.rollSpan) % (this.unitHight * this.rollRows); if (modCount < this.rollSpan) { this.proll[0].scrollTop += this.rollSpan - modCount; } else { this.proll[0].scrollTop += this.rollSpan; } } } } Cms.LeftRoller = function(rid, speed, rollSpan) { this.rid = rid; this.speed = speed; this.rollSpan = rollSpan; this.proll = $('#roll-' + rid); this.prollOrig = $('#roll-orig-' + rid); this.prollCopy = $('#roll-copy-' + rid); this.prollCopy[0].innerHTML = this.prollOrig[0].innerHTML; var o = this; this.pevent = setInterval(function() { o.roll.call(o) }, this.speed); } Cms.LeftRoller.prototype.roll = function() { if (this.proll[0].scrollLeft > this.prollCopy[0].offsetWidth) { this.proll[0].scrollLeft = this.rollSpan + 1; } else { this.proll[0].scrollLeft += this.rollSpan; } } 版主,能否指点下这个怎么看 我该去哪里设置他的属性 |
||
---|---|---|---|
1
共1页