/*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 += '