function nav(nav){ var li_width = 0; var li_len = $("#"+nav+">ul>li").length; li_width = 1200/li_len; $("#"+nav+">ul>li").width(Math.floor(li_width)); } function mswMove(boxID,btn_left,btn_right,btnBox,Car,direction,way,moveLengh,speed,Interval,number,calcback){ var _ID = $("#"+boxID+""); var _btn_left = $("#"+btn_left+""); var _btn_right = $("#"+btn_right+""); var _btnBox = $("#"+btnBox+""); var jsq = 0 var timer ; var cj ; var no_way = 0; var no_wayGet = 0; var fade = 0; var new_time = new Date; var ID_liLen , ID_liheight , cbtmBtn ; ID_liLen = _ID.find("li").length; ID_liheight = _ID.find("li").innerHeight(); if(direction == "left" || direction == "right"){ _ID.find("ul").width(ID_liLen*moveLengh*1.2); }else if(direction == "top" || direction == "bottom"){ _ID.find("ul").height(ID_liLen*moveLengh); _btnBox.hide() }else if(direction == "fade"){ _ID.find("ul").width(moveLengh).height(ID_liheight); _ID.find("li").eq(0).show().siblings().hide(); _ID.find("li").css({"position":"absolute","left":0,"top":0}); } _btnBox.empty(); for(i=0;i"); }; _btnBox.find("span").eq(0).addClass("cur"); if(way == false){ /*_btn_left.hide(); _btn_right.hide();*/ /*_btnBox.hide();*/ } function Carousel(){ if(way == false){ no_way++; if(direction == "left"){ _ID.find("ul").css({"left":-no_way}); no_wayGet = parseInt(_ID.find("ul").css("left")); if(no_wayGet == -moveLengh){ no_way = 0 _ID.find("li:first").insertAfter(_ID.find("li:last")); _ID.find("ul").css({"left":0}); } } if(direction == "right"){ no_wayGet = parseInt(_ID.find("ul").css("left")); if(no_wayGet == 0){ no_way = -moveLengh _ID.find("li:last").insertBefore(_ID.find("li:first")); _ID.find("ul").css({"left":0}); } _ID.find("ul").css({"left":no_way}); } if(direction == "top"){ _ID.find("ul").css({"top":-no_way}); no_wayGet = parseInt(_ID.find("ul").css("top")); if(no_wayGet == -moveLengh){ no_way = 0 _ID.find("li:first").insertAfter(_ID.find("li:last")); _ID.find("ul").css({"top":0}); } } if(direction == "bottom"){ no_wayGet = parseInt(_ID.find("ul").css("top")); if(no_wayGet == 0){ no_way = -moveLengh _ID.find("li:last").insertBefore(_ID.find("li:first")); _ID.find("ul").css({"top":0}); } _ID.find("ul").css({"top":no_way}); } }else if(way == true){ if(direction == "left"){ _ID.find("ul").animate({left:-moveLengh},speed,function(){ _ID.find("li:first").insertAfter(_ID.find("li:last")); _ID.find("ul").css({"left":0}); }); if(jsq0){ jsq--; _btnBox.find("span").eq(jsq).addClass("cur").siblings().removeClass("cur"); }else{ jsq = ID_liLen-1; _btnBox.find("span").eq(jsq).addClass("cur").siblings().removeClass("cur"); } } if(direction == "top"){ _ID.find("ul").animate({top:-moveLengh},speed,function(){ _ID.find("li:first").insertAfter(_ID.find("li:last")); _ID.find("ul").css({"top":0}); }); } if(direction == "bottom"){ _ID.find("li:last").insertBefore(_ID.find("li:first")); _ID.find("ul").css({"top":-moveLengh}); _ID.find("ul").stop().animate({top:0},speed); } if(direction == "fade"){ if(fadenumber){ timer = setInterval(Carousel,Interval); }else{ clearInterval(timer); /*_btn_left.hide(); _btn_right.hide(); _btnBox.hide();*/ } }else{ clearInterval(timer); } _ID.find("li").hover(function(){ clearInterval(timer); },function(){ if(Car == true){ if(ID_liLen>number){ timer = setInterval(Carousel,Interval); }else{ clearInterval(timer); /*_btn_left.hide(); _btn_right.hide(); _btnBox.hide();*/ } }else{ clearInterval(timer); } }); _btn_right.hover(function(){ clearInterval(timer); },function(){ if(Car == true){ if(ID_liLen>number){ timer = setInterval(Carousel,Interval); }else{ clearInterval(timer); /*_btn_left.hide(); _btn_right.hide(); _btnBox.hide();*/ } }else{ clearInterval(timer); } }).click(function(){ if(new Date - new_time>500){ new_time = new Date; if(direction == "left" || direction == "right"){ _ID.find("ul").animate({left:-moveLengh},speed,function(){ _ID.find("li:first").insertAfter(_ID.find("li:last")); _ID.find("ul").css({"left":0}); }); } if(direction == "top" || direction == "bottom"){ _ID.find("ul").animate({top:-moveLengh},speed,function(){ _ID.find("li:first").insertAfter(_ID.find("li:last")); _ID.find("ul").css({"top":0}); }); } if(direction == "fade"){ if(fade>0){ fade--; }else{fade = ID_liLen-1} _ID.find("li").stop(true,true).eq(fade).fadeIn(speed).siblings().fadeOut(speed); } if(jsqnumber){ timer = setInterval(Carousel,Interval); }else{ clearInterval(timer); /*_btn_left.hide(); _btn_right.hide(); _btnBox.hide();*/ } }else{ clearInterval(timer); } }).click(function(){ if(new Date - new_time>500){ new_time = new Date; if(direction == "left" || direction == "right"){ _ID.find("li:last").insertBefore(_ID.find("li:first")); _ID.find("ul").css({"left":-moveLengh}); _ID.find("ul").stop().animate({left:0},speed); } if(direction == "top" || direction == "bottom"){ _ID.find("li:last").insertBefore(_ID.find("li:first")); _ID.find("ul").css({"top":-moveLengh}); _ID.find("ul").stop().animate({top:0},speed); } if(direction == "fade"){ if(fade0){ jsq--; _btnBox.find("span").eq(jsq).addClass("cur").siblings().removeClass("cur"); }else{ jsq = ID_liLen-1; _btnBox.find("span").eq(jsq).addClass("cur").siblings().removeClass("cur"); }; }else{}; }); _btnBox.find("span").hover(function(){ clearInterval(timer); },function(){ if(Car == true){ if(ID_liLen>number){ timer = setInterval(Carousel,Interval); }else{ clearInterval(timer); /*_btn_left.hide(); _btn_right.hide(); _btnBox.hide();*/ } }else{ clearInterval(timer); } }).click(function(){ if(new Date - new_time>500){ new_time = new Date; cbtmBtn = $(this).index(); $(this).addClass("cur").siblings().removeClass("cur"); if(direction == "fade"){ _ID.find("li").eq(cbtmBtn).fadeIn(speed).siblings().fadeOut(speed); }else{ if(cbtmBtn>jsq){ cj =cbtmBtn - jsq; jsq = cbtmBtn; _ID.find("ul").stop().animate({left:-moveLengh*cj},speed,function(){ for(i=0;i500){ time = new Date; $("#"+ID+" ."+elment+":first").animate({width:'30%',left:'35%',top:'5%'}).css({'z-index':0}); $("#"+ID+" ."+elment+":first").insertAfter($("#"+ID+" ."+elment+":last")); $("#"+ID+" ."+elment+"").eq(pfnum).addClass("active").animate({width:'50%',left:'25%',top:0}).css({'z-index':number}).find(""+title+"").show(); $("#"+ID+" ."+elment+"").eq(pfnum).siblings().removeClass("active").find(""+title+"").hide(); for(i=1,th=pfnum;i500){ time = new Date; $("#"+ID+" ."+elment+":last").animate({width:''+(50-10*pfnum)+'%',left:''+(50+10*pfnum)+'%',top:''+10*pfnum+'%'}).css({'z-index':number-pfnum}); $("#"+ID+" ."+elment+":last").insertBefore($("#"+ID+" ."+elment+":first")); //$("#jzt .list").eq(pfnum).addClass('active'); $("#"+ID+" ."+elment+"").eq(pfnum).addClass("active").animate({width:'50%',left:'25%',top:0}).css({'z-index':number}).find(""+title+"").show(); $("#"+ID+" ."+elment+"").eq(pfnum).siblings().removeClass("active").find(""+title+"").hide(); for(i=1,th=pfnum;i"+_IDtext+""); _tkId.find(".imgShow").find("ul").append("
  • "+_IDtext+"

  • "); }; _tkId.find(".imgShow").find("li").width(w_width); _tkId.find(".imgShow").find("ul").width(w_width*_len); _tkId.find(".imgBox").find("li").eq(0).addClass("cur").siblings().removeClass("cur"); var imgBoxUl = 0; for(i=0;i<_len;i++){ if(imgBoxUlm && imgNum != _len-1){ var h = Math.ceil(imgNum/m); _tkId.find(".imgBox").find("ul").css({"left":-(h-1)*w_width}); }else if(imgNum == _len-1){ var h = Math.ceil(imgNum/m); _tkId.find(".imgBox").find("ul").css({"left":-(h-2)*w_width}); } _tkId.find(".imgBox").find("li").click(function(){ imgNum = $(this).index(); msw = 0; for(i=0;iimgNum && imgNum%(m-1) == 0 ){ mfz = imgNum/(m-1)-1; mfm = imgNum/(m-1); _tkId.find(".imgBox").find("ul").animate({left:-msw*(mfz/mfm)}); } msw_now = imgNum; _tkId.find(".imgShow").find("ul").stop().animate({left:-w_width*imgNum}); _tkId.find(".imgBox").find("li").eq(imgNum).addClass("cur").siblings().removeClass("cur"); }); }); _tkId.find(".btn02").click(function(){ if(imgNum<_len-1){ imgNum++; msw = 0; a = 0; for(i=0;i0){ imgNum--; msw = 0; for(i=0;iimgNum && imgNum%(m-1) == 0 ){ mfz = imgNum/(m-1)-1; mfm = imgNum/(m-1); _tkId.find(".imgBox").find("ul").animate({left:-msw*(mfz/mfm)}); } msw_now = imgNum; _tkId.find(".imgShow").find("ul").stop().animate({left:-w_width*imgNum}); _tkId.find(".imgBox").find("li").eq(imgNum).addClass("cur").siblings().removeClass("cur"); }else{ alert("this is first!"); imgNum = 0; }; }); }