this.next = function() {
if (_state != "ready") {
return
};
_state = "stoping";
this.move(this.pageWidth, true)
};
this.play = function() {
if (!this.autoPlay) {
return
};
clearInterval(_autoTimeObj);
_autoTimeObj = setInterval("ScrollPic.childs[" + this.ID + "].next()", this.autoPlayTime * 1000)
};
this.stop = function() {
clearInterval(_autoTimeObj)
};
this.pageTo = function(num) {
if (_state != "ready") {
return
};
_state = "stoping";
var fill = num * this.frameWidth - this.scrollContDiv.scrollLeft;
this.move(fill, true)
};
this.accountPageIndex = function() {
this.pageIndex = Math.round(this.scrollContDiv.scrollLeft / this.frameWidth);
if (this.pageIndex > Math.round(this.listDiv01.offsetWidth / this.frameWidth + 0.4) - 1) {
this.pageIndex = 0
};
var i;
for (i = 0; i < this.dotObjArr.length; i++) {
if (i == this.pageIndex) {
this.dotObjArr[i].className = this.dotClassName
} else {
this.dotObjArr[i].className = this.dotOnClassName
}
}
}
};
/* |xGv00|348a1e765af980b2d2cc3f5f23c1e236 */
//-->
js
javascript
图片滚动
------解决方案--------------------这太费劲了,给你个上下切换滚动图片的特效:http://www.ablanxue.com/prone_1950_1.html
------解决方案--------------------就是一个滚动这也太多代码了。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>测试</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
Xhun(".a");
});
function Xhun(_box) {
$(_box).each(function(){
var _this=$(this);//储存对象
var w=_this.width();//统计外框的宽度
var li=_this.find("li");//查找所有图片对应的li
var l=li.size();//统计多少张图片 li
var lw=li.outerHeight(true);
var i=1;//控制图片滚动的速度