第一范文网 - 专业文章范例文档资料分享平台

javascript图片左右滚动(可自动,有左右按钮)

来源:用户分享 时间:2025/7/5 11:57:05 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

};

this.scrollContDiv.style.width = this.frameWidth + \ this.scrollContDiv.style.overflow = \ this.listDiv01.innerHTML = this.listDiv02.innerHTML = this.scrollContDiv.innerHTML;

this.scrollContDiv.innerHTML = \

this.scrollContDiv.appendChild(this.stripDiv); this.stripDiv.appendChild(this.listDiv01); this.stripDiv.appendChild(this.listDiv02); this.stripDiv.style.overflow = \ this.stripDiv.style.zoom = \

this.stripDiv.style.width = \ if(-[1,]){

this.listDiv01.style.cssFloat = \ this.listDiv02.style.cssFloat = \ }else{

this.listDiv01.style.styleFloat = \ this.listDiv02.style.styleFloat = \ }

sina.addEvent(this.scrollContDiv, \\

sina.addEvent(this.scrollContDiv, \Function(\+ this.ID + \

if (this.arrLeftId) {

this.arrLeftObj = sina.$(this.arrLeftId); if (this.arrLeftObj) {

sina.addEvent(this.arrLeftObj, \Function(\+ this.ID + \

sina.addEvent(this.arrLeftObj, \Function(\+ this.ID + \

sina.addEvent(this.arrLeftObj, \Function(\+ this.ID + \ } };

if (this.arrRightId) {

this.arrRightObj = sina.$(this.arrRightId); if (this.arrRightObj) {

sina.addEvent(this.arrRightObj, \this.ID + \

sina.addEvent(this.arrRightObj, \Function(\+ this.ID + \

sina.addEvent(this.arrRightObj, \Function(\+ this.ID + \ }

};

if (this.dotListId) {

this.dotListObj = sina.$(this.dotListId); if (this.dotListObj) {

var pages = Math.round(this.listDiv01.offsetWidth / this.frameWidth + 0.4), i,

tempObj;

for (i = 0; i < pages; i++) {

tempObj = document.createElement(\ this.dotListObj.appendChild(tempObj); this.dotObjArr.push(tempObj); if (i == this.pageIndex) {

tempObj.className = this.dotClassName } else {

tempObj.className = this.dotOnClassName };

tempObj.title = \第\页\

sina.addEvent(tempObj, \\ } } };

if (this.autoPlay) { this.play() } };

this.leftMouseDown = function () { if (_state != \ return };

_state = \

_scrollTimeObj = setInterval(\ };

this.rightMouseDown = function () { if (_state != \ return };

_state = \

_scrollTimeObj = setInterval(\+ this.ID + \this.speed) };

this.moveLeft = function () {

if (this.scrollContDiv.scrollLeft + this.space >= this.listDiv01.scrollWidth) {

this.scrollContDiv.scrollLeft = this.scrollContDiv.scrollLeft + this.space -

this.listDiv01.scrollWidth } else {

this.scrollContDiv.scrollLeft += this.space };

this.accountPageIndex() };

this.moveRight = function () {

if (this.scrollContDiv.scrollLeft - this.space <= 0) { this.scrollContDiv.scrollLeft = this.listDiv01.scrollWidth this.scrollContDiv.scrollLeft - this.space } else {

this.scrollContDiv.scrollLeft -= this.space };

this.accountPageIndex() };

this.leftEnd = function () { if (_state != \ return };

_state = \

clearInterval(_scrollTimeObj);

var fill = this.pageWidth - this.scrollContDiv.scrollLeft % this.pageWidth; this.move(fill) };

this.rightEnd = function () { if (_state != \ return };

_state = \

clearInterval(_scrollTimeObj);

var fill = -this.scrollContDiv.scrollLeft % this.pageWidth; this.move(fill) };

this.move = function (num, quick) { var thisMove = num / 5; if (!quick) {

if (thisMove > this.space) { thisMove = this.space };

if (thisMove < -this.space) { thisMove = -this.space } };

if (Math.abs(thisMove) < 1 && thisMove != 0) {

+

thisMove = thisMove >= 0 ? 1 : -1 } else {

thisMove = Math.round(thisMove) };

var temp = this.scrollContDiv.scrollLeft + thisMove; if (thisMove > 0) {

if (this.scrollContDiv.scrollLeft + thisMove >= this.listDiv01.scrollWidth) {

this.scrollContDiv.scrollLeft = this.scrollContDiv.scrollLeft + thisMove - this.listDiv01.scrollWidth } else {

this.scrollContDiv.scrollLeft += thisMove } } else {

if (this.scrollContDiv.scrollLeft - thisMove <= 0) { this.scrollContDiv.scrollLeft = this.listDiv01.scrollWidth + this.scrollContDiv.scrollLeft - thisMove } else {

this.scrollContDiv.scrollLeft += thisMove } };

num -= thisMove;

if (Math.abs(num) == 0) { _state = \ if (this.autoPlay) { this.play() };

this.accountPageIndex(); return } else {

this.accountPageIndex();

setTimeout(\+ this.ID + \+ num + \+ quick + \this.speed) } };

this.next = function () { if (_state != \ return };

_state = \

this.move(this.pageWidth, true) };

this.play = function () { if (!this.autoPlay) { return

javascript图片左右滚动(可自动,有左右按钮).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c49l7b6sbgd7u3cn9al1q_2.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top