/*更新时间:2016-11-17*/ function nav(nav){ var li_width = 0; var nav_width = 0; var li_pa; var li_len = $("#"+nav+">ul>li").length; for(i=0;iul>li").eq(i).outerwidth(); } li_pa = math.floor(($("#"+nav+"").width()-nav_width)/li_len*0.5); $("#"+nav+">ul>li>a").css({"padding-left":li_pa,"padding-right":li_pa}); nav_width = 0; for(i=0;iul>li").eq(i).outerwidth(); } var last_pa = $("#"+nav+"").width()-nav_width $("#"+nav+">ul>li>a:last").css({"padding-right":li_pa+last_pa*0.5,"padding-left":li_pa+last_pa*0.5}) if($("#"+nav+">ul").height()>$("#"+nav+">ul>li").height()){ $("#"+nav+">ul>li>a:last").css({"padding-right":li_pa+last_pa*0.5,"padding-left":li_pa+last_pa*0.5-1}) } }/*end nav()*/ function mswmove(boxid,btn_left,btn_right,btnbox,car,direction,way,movelengh,speed,interval,number){ 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); }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:''+pre+'%',left:''+(100-pre)/2+'%',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:''+(pre-10*pfnum)+'%',left:''+100-(pre-10*pfnum)+'%',top:''+7.5*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:''+pre+'%',left:''+(100-pre)/2+'%',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
style: .tankuang { overflow:hidden; width:100%; height:100%; position:fixed; left:0; top:0; background:url(img/common/dsz06_tuwen.png) repeat center; z-index:99999999999; display:none} .tankuang .bg{ display:block; width:100%; height:100%; background-color:#000; opacity:0.8; filter:alpha(opacity=80); position:absolute; left:0; top:0; z-index:0} .tankuang .close{ display:block; position:absolute; right:10px; top:10px; background:url(img/common/in_ry_tk_close.png) no-repeat center; width:30px; height:30px; cursor:pointer} .tankuang span{ display:block; width:28px; height:49px; cursor:pointer; position:absolute; top:36%; z-index:5} .tankuang .btn01{ left:20px; background:url(img/index/fzlcleft.png) no-repeat center;} .tankuang .btn02{ right:20px; background:url(img/index/fzlcright.png) no-repeat center;} .tankuang .imgshow { overflow:hidden; width:100%; height:60%; position:absolute; left:0; top:15%;moz-user-select: -moz-none; -moz-user-select: none; -o-user-select:none; -khtml-user-select:none; -webkit-user-select:none; -ms-user-select:none; user-select:none;} .tankuang .imgshow ul{ overflow:hidden; position:absolute; height:100%;} .tankuang .imgshow li{ float:left; text-align:center; height:100%;} .tankuang .imgshow li img{ display:block; margin:0 auto; height:90%;} .tankuang .imgshow li p{ font-size:18px; color:#fff; text-align:center;} .tankuang .imgbox{ overflow:hidden; width:100%; height:80px; position:absolute; left:0; bottom:5%} .tankuang .imgbox ul{ overflow:hidden; position:absolute; height:100%; padding-right:5px;} .tankuang .imgbox li{ float:left; height:100%; padding:0 5px; cursor:pointer} .tankuang .imgbox li img{ display:block; height:70px; padding:5px; background-color:#fff;moz-user-select: -moz-none; -moz-user-select: none; -o-user-select:none; -khtml-user-select:none; -webkit-user-select:none; -ms-user-select:none; user-select:none;} .tankuang .imgbox li em{ display:none} .tankuang .imgbox li.cur img{ background:#ff0000 } */ function tankuang(id,clickelement,title,showh,tkid){ var _tkid = $("#"+tkid+""); var _id = $("#"+id+"") ; var _cke = $("#"+id+" "+clickelement+""); var _close = $("#"+tkid+"").find(".close"); var _len = $("#"+id+" "+clickelement+"").length; var _idimg , _idtext , w , m , n = 0 , a=0 , _width , imgnum = 0; var w_width = $(window).width(); _tkid.find(".imgshow").find("li").width(w_width); if(showh == true){ _tkid.find("p").show(); _tkid.find("p").siblings("img").css({"height":"90%"}); }else{ _tkid.find("p").hide(); _tkid.find("p").siblings("img").css({"height":"100%"}); }; _close.click(function(){ _tkid.fadeout(500); _tkid.find(".imgshow").find("ul").css({"left":0}) imgnum = 0;n = 0;w=0;m=0; _tkid.find(".imgbox").find("ul").empty(); _tkid.find(".imgshow").find("ul").empty(); }); _cke.click(function(){ imgnum = $("#"+id+" "+clickelement+"").index(this) _tkid.fadein(500); _tkid.find(".imgbox").find("ul").empty(); _tkid.find(".imgshow").find("ul").empty(); for(i=0;i<_len;i++){ _idimg = _id.find(clickelement).eq(i).find("img").attr("src"); _idtext = _id.find(clickelement).eq(i).find(title).text(); _tkid.find(".imgbox").find("ul").append("
  • "+_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"); _width = _tkid.find(".imgbox").find("li").innerwidth()+1; var imgboxul = 0; for(i=0;i<_len;i++){ imgboxul += _tkid.find(".imgbox").find("li").eq(i).innerwidth()+1; } _tkid.find(".imgbox").find("ul").width(imgboxul); _tkid.find(".imgshow").find("ul").css({"left":-w_width*imgnum}) _tkid.find(".imgbox").find("li").eq(imgnum).addclass("cur").siblings().removeclass("cur"); m = math.floor(w_width/_width)-1; w = math.floor(_len/m); _tkid.find(".imgbox").find("li").click(function(){ imgnum = $(this).index(); _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){ if(imgnum%m == 1 && imgnum!=1 ){ n++; if(n>w){ n=w; _tkid.find(".imgbox").find("ul").animate({left:-m*(_width*n-1)}); }else{ _tkid.find(".imgbox").find("ul").animate({left:-m*(_width*n-1)}); }; }; imgnum++; console.log(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("已经到尽头了"); imgnum = _len-1; } ; }); _tkid.find(".btn01").click(function(){ if(imgnum>0){ if(imgnum%m == 0 && imgnum!=0){ n--; _tkid.find(".imgbox").find("ul").animate({left:-m*(_width*n-1)}) }; imgnum--; console.log(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("已经到尽头了"); imgnum = 0; }; }); } //tankuang() end