/*public*/ /*public*/ /*ea_h*/ /*ea_h*//*ea_n*/ /*xn_mn_2_wrap*/ $(function(){ if ($('#xn_mn_2_wrap').length>0) { var xn_nav = $('.xn_mn_2_nav'); var xn_nav_box = xn_nav.children('.xn_mn_2_box'); var xn_nav_ul = xn_nav.children('ul'); xn_nav_ul.height($(document).height()); // xn_nav_ul.hide(); // xn_nav_box.click(function() { // $(this).toggleClass('xn_mn_2_box_curr'); // xn_nav_ul.stop().slideToggle(400); // }); xn_nav_box.click(function() { xn_nav.css('overflow', 'visible'); xn_nav_ul.stop().animate({right: 0}, 400); $(".xn_mn_2_wrap").height($(document).height()); }); $('.xn_mn_2_close').click(function(){ xn_nav_ul.stop().animate({right: -xn_nav_ul.width()},400,function(){xn_nav.css('overflow', 'hidden')}); $(".xn_mn_2_wrap").css('height', 'auto'); console.log(xn_nav_ul.width()) }); } }) /*end_xn_mn_2_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 = 3000; $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_3_wrap*/ //微商用20160621 $ && $(function () { if ($("#EIMS_C_50055_Panel").length > 0) { EIMS_C_50055.Init(); } }); var EIMS_C_50055 = { Config: { SerarchPage: "/m/search.aspx", //搜索结果页面 AllHotItem: null, HotItemIndex: 0 }, Init: function () { EIMS_C_50055.RefreshSearchHistory(); EIMS_C_50055.Config.AllHotItem = $('.EIMS_C_50055_HotSearch a'); $("#EIMS_C_50055_GoSearch").on("click", function () { var key = $("#EIMS_C_50055_SearchInput").val().trim(); if (!key) { return; } var keyList = localStorage.getItem("KeyList"); if (!keyList) { localStorage.setItem("KeyList", [key]); } else if (keyList.split(',').indexOf(key) < 0) { localStorage.setItem("KeyList", keyList + "," + key); } window.location.href = MergeUrlParas(EIMS_C_50055.Config.SerarchPage, false, ["key"], [key]); }); //清除搜索历史 $("#EIMS_C_50055_ClearHistory").on("click", function (ev) { localStorage.removeItem("KeyList"); EIMS_C_50055.RefreshSearchHistory(); }); $(".EIMS_C_50055_HotSearch").show(); EIMS_C_50055.Config.HotItemIndex = 0;//其实索引 从0开始 EIMS_C_50055.InitHotItem(); $("#EIMS_C_50055_HotRefresh").click(function () { EIMS_C_50055.InitHotItem(); }); $(".EIMS_C_50055_HotSearch").on("click", "a", function() { window.location.href = MergeUrlParas(EIMS_C_50055.Config.SerarchPage, false, ["keyword"], [$(this).text()]); }); $("#EIMS_C_50055_HistorySearch").on("click", "li", function () { window.location.href = MergeUrlParas(EIMS_C_50055.Config.SerarchPage, false, ["keyword"], [$(this).text()]); }); }, InitHotItem: function () { if (EIMS_C_50055.Config.AllHotItem.length <= 4) { return false; } $('.EIMS_C_50055_HotSearch a').remove(); //清除所有 var nextEnd = EIMS_C_50055.Config.HotItemIndex + 7;//下一页数据条数 var isAppend = false; for (var i = EIMS_C_50055.Config.HotItemIndex; i <= nextEnd; i++) { if (i >= EIMS_C_50055.Config.AllHotItem.length) {//如果数据条数不够从头开始将元素想后追加 EIMS_C_50055.Config.HotItemIndex = 0; nextEnd = 0; isAppend = true; } if (isAppend) {//是否需要补充数据 var currentLength = $('.EIMS_C_50055_HotSearch a').length; //当前有多少个热搜词 for (var j = 0; j < 4 - currentLength; j++) {//补充缺少的热搜词 $('.EIMS_C_50055_HotSearch').append(EIMS_C_50055.Config.AllHotItem.eq(j)); } } else { $('.EIMS_C_50055_HotSearch').append(EIMS_C_50055.Config.AllHotItem.eq(i)); } } EIMS_C_50055.Config.HotItemIndex = nextEnd;//下一次的起始索引 }, //获取历史搜索关键词 RefreshSearchHistory: function () { var keyList = localStorage.getItem("KeyList"); if (!keyList) { $("#EIMS_C_50055_HistorySearchDiv").hide(); return; } var innerHtml = ""; keyList.split(',').forEach(function (item) { innerHtml += '
  • ' + item + '
  • '; }); $("#EIMS_C_50055_HistorySearch").html(innerHtml); $("#EIMS_C_50055_HistorySearchDiv").show(); }, //删除指定历史关键词 DeleteKey: function (key, obj) { var keylist = localStorage.getItem("KeyList"); if (keylist) { var arr = keylist.split(',').filter(function (item) { return item != key; }); localStorage.setItem("KeyList", arr); $(obj).parent().remove(); } } }; /*end_xn_mc_index_3_wrap*/ /*xn_mc_index_1_2_wrap*/ function setImageindex1(){ var img_height=$('.xn_mc_index_1_2_conten img:eq(0)').height(); $('.xn_mc_index_1_2_conten img').each(function(){ $(this).parent().height(img_height); }); $('.xn_mc_index_1_2_conten img').unbind('load').bind('load',function(){ setTimeout(function() { var img_height=$('.xn_mc_index_1_2_conten img:eq(0)').height(); $('.xn_mc_index_1_2_conten img').each(function(){ $(this).parent().height(img_height); }); }, 1000); }); } $(function(){ if($("#xn_mc_index_1_2_wrap").length > 0){ setImageindex1(); $(window).resize(function(){ setImageindex1();}) } }); /*end_xn_mc_index_1_2_wrap*/ /*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_10_wrap*/ /*end_xn_mc_index_10_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_c_index_573_wrap*/ $(function(){ var wrap_len = $("#xn_c_index_573_wrap").length; if(wrap_len>0){ var autoque = true; //是否自动滚动 var speed = 500; //滚动速度 var n =3; //每屏显示个数 var cont_w = $(".xn_c_index_573_cont").width(); var cli = $(".xn_c_index_573_inner li"); var cul = $(".xn_c_index_573_inner .xn_c_index_573_inner_box"); var count = cli.length; var cur = 0; //当前屏 var size = Math.ceil(count/n); cul.css("width",size*cont_w); for(var i=0;i"); } var datetime; //自动滚动属性 $('.xn_c_index_573_inner').hover(function(){ clearInterval(datetime); },function(){ if(autoque){ datetime = setInterval(function(){ cul.find(".xn_c_index_573_div:first").stop().animate({"margin-left":-cont_w},speed,function(){ $(this).css("margin-left","0").appendTo(cul); }); },3000); } }).trigger('mouseleave'); //左切换 $("#xn_c_index_573_prev").bind("click",function(){ cul.find(".xn_c_index_573_div:last").prependTo(cul); cul.find(".xn_c_index_573_div:first").css("margin-left",-cont_w).stop().animate({"margin-left":"0"},speed); }); //右切换 $("#xn_c_index_573_next").bind("click",function(){ cul.find(".xn_c_index_573_div:first").stop().animate({"margin-left":-cont_w},speed,function(){ $(this).css("margin-left","0").appendTo(cul); }); }); } }); /*end_xn_c_index_573_wrap*/ /*ea_c*/ /*ea_b*/ /*xn_mb_1_wrap*/ /*end_xn_mb_1_wrap*/ /*ea_b*/ /*ea_bg*/ /*ea_bg*/ /*ea_sh*/ /*ea_sh*/ /*ea_mu*/ /*xn_mu_1_wrap*/ /*end_xn_mu_1_wrap*/ /*ea_mu*/