数码资讯
jQuery制作的一个简单的图片旋转木马效果
演示: 核心代码: $(文档)Ready(函数(){) VaR IBOX =美元美元('。imgbox), $ iNum =美元('。imgnum '), / /缓存优化 索引法= 1, / /初始。 totalimg = 4, / /图片总数 imgsize = 300, / /图片尺寸宽度 Mo
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
演示:
核心代码:
$(文档)Ready(函数(){)
VaR IBOX =美元美元('。imgbox),
$ iNum =美元('。imgnum '), / /缓存优化
索引法= 1, / /初始。
totalimg = 4, / /图片总数
imgsize = 300, / /图片尺寸宽度
MoveTime = 1100, / / animation switching time
时间= 2500, / /中间停顿时间
CLC = null;
功能moveimg(){
如果(索引法!= totalimg){
ibox.animate美元({
左:-(索引法* imgsize)+ 'px
},帧);
inum.removeclass美元('mark-color)
情商(索引法)。
addClass('mark-color);
索引法+ +;
}
别的{
索引法= 1;
inum.removeclass美元('mark-color)
情商(索引法- 1)。
addClass('mark-color);
ibox.animate美元({
左:0
},帧);
}
}
inum.hover美元(函数(){()
($ IBOX。停止); / /当前动画结束
ClearInterval(CLC); / /暂停周期
inum.removeclass美元('mark-color);
$(这)AddClass('mark-color);
索引法= $(this)指数();
ibox.animate美元({
左:-(索引法* imgsize)+ 'px
},500);
}函数(){()
CLC = setInterval(moveimg、时间);
});
CLC = setInterval(moveimg、时间);
});
以上是本文的全部内容,希望大家能喜欢。
核心代码:
$(文档)Ready(函数(){)
VaR IBOX =美元美元('。imgbox),
$ iNum =美元('。imgnum '), / /缓存优化
索引法= 1, / /初始。
totalimg = 4, / /图片总数
imgsize = 300, / /图片尺寸宽度
MoveTime = 1100, / / animation switching time
时间= 2500, / /中间停顿时间
CLC = null;
功能moveimg(){
如果(索引法!= totalimg){
ibox.animate美元({
左:-(索引法* imgsize)+ 'px
},帧);
inum.removeclass美元('mark-color)
情商(索引法)。
addClass('mark-color);
索引法+ +;
}
别的{
索引法= 1;
inum.removeclass美元('mark-color)
情商(索引法- 1)。
addClass('mark-color);
ibox.animate美元({
左:0
},帧);
}
}
inum.hover美元(函数(){()
($ IBOX。停止); / /当前动画结束
ClearInterval(CLC); / /暂停周期
inum.removeclass美元('mark-color);
$(这)AddClass('mark-color);
索引法= $(this)指数();
ibox.animate美元({
左:-(索引法* imgsize)+ 'px
},500);
}函数(){()
CLC = setInterval(moveimg、时间);
});
CLC = setInterval(moveimg、时间);
});
以上是本文的全部内容,希望大家能喜欢。
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。