/*public*/ /*public*/ /*ea_h*/ /*ea_h*/ /*ea_n*/ /*xn_mn_1_wrap*/ /*end_xn_mn_1_wrap*/ /*ea_n*/ /*ea_ba*/ /*xn_index_mba_1_wrap*/ var IsFast=true; var isAutoPlay = true; var banner=function(){ if($("#xn_index_mba_1_wrap").length > 0){ var $wrap = $("#xn_index_mba_1_wrap"); var $main = $(".xn_index_mba_1_main"); var $ul = $(".xn_index_mba_1_ul"); var $li = $ul.children("li"); var $lights = $(".xn_index_mba_1_lights"); var speed =300; var $curr_class = "xn_index_mba_1_lightsCurr"; var timeInterval = 5000; $li.css("width",parseInt($main.outerWidth(true))); $ul.css("width",$li.length * $li.outerWidth(true)); $lights.html(""); $li.each(function(){ $lights.append(""); $(this).attr("lights",$(this).index()); }); var idx; var size = $li.size(); //点击焦点图切换: $lights.children().first().addClass($curr_class); $lights.children("span").click(function(){ var index = $(this).index(); idx = parseInt($ul.children().first().attr("lights")); var num = index-idx; num = num>0?num:num+size; for(var i = 0;i < num ;i++){ $ul.append($ul.children().first()); } $ul.stop().animate({"left":0},speed); idx = $ul.children().first().attr("lights"); $lights.children().eq(idx).addClass($curr_class).siblings().removeClass($curr_class); //$ul.animate({"left":-index*$li.outerWidth(true)},speed); //$(this).addClass($curr_class).siblings().removeClass($curr_class); }); //左右切换: function nextImg(){ $ul.stop().animate({left:"-"+$li.outerWidth(true) +"px"},speed,function(){ $ul.append($ul.children().first()); $ul.css("left",0); idx = $ul.children().first().attr("lights"); $lights.children().eq(idx).addClass($curr_class).siblings().removeClass($curr_class); return idx; }); } function prevImg(){ $ul.css('left',-$li.outerWidth(true)); $ul.prepend($ul.children().last()); $ul.stop().animate({"left":0},speed); idx = $ul.children().first().attr("lights"); $lights.children().eq(idx).addClass($curr_class).siblings().removeClass($curr_class); } if(IsFast){ IsFast=false; var auto = setInterval(function(){ if(isAutoPlay){ nextImg(); } },timeInterval); } $ul.mouseover(function(){ clearInterval(auto); }); $ul.mouseleave(function(){ IsFast=false; auto = setInterval(function(){ if(isAutoPlay){ nextImg(); } },timeInterval); }); var dragDistance = 80 ; var dragY = 20; } } $(function(){ banner(); $(window).resize(function(){ banner();}) }); /*end_xn_index_mba_1_wrap*/ /*ea_ba*//*ea_c*/ /*xn_mc_index_1_wrap*/ function setImageindex1(){ var img_height=$('.xn_mc_index_1_conten img:eq(0)').height(); $('.xn_mc_index_1_conten img').each(function(){ $(this).parent().height(img_height); }); $('.xn_mc_index_1_conten img').unbind('load').bind('load',function(){ setTimeout(function() { var img_height=$('.xn_mc_index_1_conten img:eq(0)').height(); $('.xn_mc_index_1_conten img').each(function(){ $(this).parent().height(img_height); }); }, 1000); }); } $(function(){ if($("#xn_mc_index_1_wrap").length > 0){ setImageindex1(); $(window).resize(function(){ setImageindex1();}) } }); /*end_xn_mc_index_1_wrap*/ /*xn_mc_index_14_wrap*/ function setImageindex14(){ var img_height=$('.xn_mc_index_14_lftbox img:eq(0)').height(); $('.xn_mc_index_14_lftbox img').each(function(){ $(this).parent().parent().parent().height(img_height); }); $('.xn_mc_index_14_lftbox img').unbind('load').bind('load',function(){ setTimeout(function() { var img_height=$('.xn_mc_index_14_lftbox img:eq(0)').height(); $('.xn_mc_index_14_lftbox img').each(function(){ $(this).parent().parent().parent().height(img_height); }); }, 1000); }); } $(function(){ if($("#xn_mc_index_14_wrap").length > 0){ setImageindex14(); } $(window).resize(function(){ setImageindex14();}) }); /*end_xn_mc_index_14_wrap*/ /*xn_mc_index_11_wrap*/ /*end_xn_mc_index_11_wrap*/ /*ea_c*/ /*ea_b*/ /*xn_mb_1_wrap*/ /*end_xn_mb_1_wrap*/ /*ea_b*/ /*ea_bg*/ /*ea_bg*/ /*ea_sh*/ /*xn_sh_1_wrap*/ function openShareSwitch(){ $("#share_switch").click(); } /*end_xn_sh_1_wrap*/ /*ea_sh*/ /*ea_mu*/ /*xn_mu_1_wrap*/ /*end_xn_mu_1_wrap*/ /*ea_mu*/