日期:2014-05-16 浏览次数:20474 次
$(document).ready(function(){ var pageCounter={//页面记数器 pages:1, currentPage:1, getPageUp:function(){//获得上一页 var _pageUp=this.currentPage-1; if(_pageUp<1){ _pageUp=this.pages; } return _pageUp; }, getPageDown:function(){//获得上一页 var _pageDown=this.currentPage+1; if(_pageDown>this.pages){ _pageDown=1; } return _pageDown; }, pageUp:function(){//向上翻页 var _prePage=this.getPageUp(); this.currentPage=_prePage; }, pageDown:function(){//向下翻页 var _nextPage=this.pageDown(); this.currentPage=_nextPage; } }; //initPpt();//初始化 pageCounter.pages=5; var pptSwitch=function(){ //$('#bgImgPPT').find('img').eq(pageCounter.currentPage).animate({'top':'0px'},2500).fadeOut(250); pageCounter.pageDown(); alert(pageCounter.currentPage); //$('#bgImgPPT').find('img').eq(pageCounter.currentPage).fadeIn(250).animate({'top':'0px'},2500); } var ppt=setInterval(function(){pptSwitch()},3000); });
pageDown:function(){//向下翻页 var _nextPage=this.pageDown(); this.currentPage=_nextPage; }
------解决方案--------------------