var menu = function (obj) { var nid = parseInt(util.queryString("nid")); if (isNaN(nid)) { nid = 0; } if (nid > 0) { var navi = obj.find("li[data-nid=" + nid + "]"); var tid = parseInt(util.queryString("typeid")); if (isNaN(tid)) { tid = parseInt(util.queryString("tid")); } var li = obj.children(".xg_menuUl").children("li[data-tid=" + tid + "]"); if (li.length > 0) { li.addClass(li.attr("class").split(" ")[0] + "-select"); } else if (navi.length > 0) { navi.addClass(navi.attr("class").split(" ")[0] + "-select"); if (tid > 0) { var li = navi.find("li[data-tid=" + tid + "]"); if (li.length > 0) { li.addClass(li.attr("class").split(" ")[0] + "-select"); li.parentsUntil(".xg_menu", "li").each(function () { $(this).addClass($(this).attr("class").split(" ")[0] + "-select"); actived = true; return false; }); } } } } else { var url = util.createUrl(); if ( url.replace(document.location.host, "").indexOf(".") == -1 || url.indexOf("index.html") > 0 ) { var home = obj.find("li[home=1]"); if (home.length > 0) home.addClass(home.attr("class").split(" ")[0] + "-select"); } } var showType = obj.data("mobileshoweffect"); obj.find(".xg_menuMobile .xg_memu_btn").on("click", function () { if (showType == 0 || showType == 2) { $(this).next().css({ left: "0px" }); } else if (showType == 1 || showType == 3) { $(this).next().css({ top: "0px" }); } setTimeout(function () { obj.find("img").lazyload(); }, 300); }); obj.find(".xg_menuShade").on("click", function () { var css = {}; if (showType == 0) { css = { left: "-100%" }; } else if (showType == 1) { css = { top: "-100%" }; } else if (showType == 2) { css = { left: "100%" }; } else if (showType == 3) { css = { top: "100%" }; } $(this).parent().css(css); }); obj .children(".xg_menuMobile") .find(".xg_menuTitle1,.xg_menuTitle2,.xg_menuTitle3,.xg_menuTitle4") .on("click", function (e) { var ul = $(this).next(); if (ul.length == 0) { return true; } ul.slideToggle(); return true; }); var design = util.inDesign(); if (obj.data("droptype") == "1" && page.currentDevice() == 1) { var ul = obj.children(".xg_menuUl"); var needEffect = obj.data("effect"); if (!needEffect) { needEffect = 0; } var menulis = ul.children("li"); var droplist = obj.children(".xg_dropdownlist"); if (droplist.length > 0) { menulis.hover( function () { clearTimeout($(this).data("menuHide")); var id = $(this).data("nid"); if (!id) { id = $(this).data("tid"); } if (!id) { return; } var mWidth = $(this).parents(".container").width(); droplist.css({ width: document.documentElement.clientWidth + "px", height: "0px", "min-width": mWidth + "px", position: "absolute", top: ul.height() + "px", }); if (droplist.offset().left != 0) { var mLeft = parseInt(droplist.css("margin-left")); isNaN(mLeft) && (mLeft = 0); var left = mLeft - droplist.offset().left; droplist.css({ "margin-left": left + "px" }); } var list = droplist.children("[data-rid=" + id + "]"); if (list.length == 0) { return; } list.siblings().hide(); if (needEffect == 0) { list.show(); } else { list.stop().slideDown("fast"); } }, function () { var _this = $(this); var id = _this.data("nid"); if (!id) { id = _this.data("tid"); } if (!id) { return; } var list = droplist.children("[data-rid=" + id + "]"); if (list.length == 0) { return; } clearTimeout(_this.data("menuHide")); _this.data( "menuHide", setTimeout(function () { if (needEffect == 0) { list.hide(); } else { list.stop().slideUp("fast"); } }, 120) ); } ); droplist.children("div").hover( function () { var id = $(this).data("rid"); menulis.each(function () { var _that = $(this); var mid = _that.data("nid"); if (!mid) { mid = _that.data("tid"); } if (mid == id || mid == id) { clearTimeout(_that.data("menuHide")); } }); }, function () { if (needEffect == 0) { $(this).hide(); } else { $(this).stop().slideUp("fast"); } } ); } } }; var tab = { init: function (tabid) { var obj = $("#" + tabid); var evt = obj.data("switch"); if (!evt) { util.log("事件不存在"); return; } var datalist = obj.parents(".xg_list:first"); if (datalist.length > 0) { var className = ""; var parent = obj; while (!parent.is(datalist) && !className) { var strs = parent.attr("class").split(" "); for (var i = 0; i < strs.length; i++) { if (strs[i] && /^p[\d]+/.test(strs[i])) { className = strs[i]; break; } } parent = parent.parent(); } var tabs = null; if (className) { tabs = datalist.find("." + className); } else { tabs = datalist.find(".xg_tab"); } tabs.children(".xg_tab_l_t").find("ul li").on(evt, tab.show); } else { obj.children(".xg_tab_l_t").find("ul li").on(evt, tab.show); } }, show: function () { var _this = $(this); var index = _this.data("index"); var content = _this .parent() .parent() .parent() .find(".xg_tab_tt") .eq(parseInt(index)); content .addClass("xg_tab_tt-select") .siblings() .removeClass("xg_tab_tt-select"); var checkarr = $(this).attr("class").split(/[ ,]/); var pmcid = "xg_tab_tl"; for (j = 0; j < checkarr.length; j++) { var currcheck = checkarr[j].replace(".", ""); if (/p\d+(m|c|\-m|\-c)\S/.test(currcheck)) { if (/-select$/.test(currcheck)) continue; pmcid = currcheck; } } _this.addClass(pmcid + "-select"); $.each(_this.siblings(), function () { var arrCls = this.className.split(/[ ,]/); for (c = 0; c < arrCls.length; c++) { if (/-select$/.test(arrCls[c])) { $(this).removeClass(arrCls[c]); } } }); content.find(".xg_video").each(function () { myplayer.tabChange($(this).attr("id")); }); if (typeof page.registeTabReload != "undefined") { for (var i = 0; i < page.registeTabReload.length; i++) { page.registeTabReload[i](content, index); } } }, changeitem: function (currSelect) { if (currSelect.length > 0) { var csslist = currSelect.attr("class").split(/[ ,]/); var currids = "xg_tab_tl-select"; for (h = 0; h < csslist.length; h++) { if (/p\d+(m|c|\-m|\-c)\S/.test(csslist[h])) { if (/-select$/.test(csslist[h])) continue; currids = csslist[h]; currSelect .removeClass("xg_tab_tl-select") .addClass(currids + "-select"); } } } }, }; $(function () { menu($("#if1798075ff88e13e9583b7")); }); $(function () { menu($("#if1798012ca002ce1b70bc5")); }); (function (root) { root.find(".xg_list>div>.data_col ").each(function () { var _this = $(this).children(); _this.next().hide(); _this.find(".xg_img ").eq(1).hide(); _this .find(".xg_img ") .eq(0) .click(function () { root.find(".xg_list>div>.data_col>.row:odd").hide(); root .find(".xg_list>div>.data_col>.row:even") .find(".xg_img:even") .show(); root .find(".xg_list>div>.data_col>.row:even") .find(".xg_img:odd") .hide(); _this.next().show(); $(this).hide(); $(this).parent().next().children().show(); }); _this .find(".xg_img ") .eq(1) .click(function () { root.find(".xg_list>div>.data_col>.row:odd").hide(); _this.next().hide(); $(this).hide(); $(this).parent().prev().children().show(); }); }); root.find(".xg_list .data_col ").eq(0).children().next().show(); root .find(".xg_list .data_col ") .eq(0) .children() .find(".xg_img ") .eq(1) .show(); root .find(".xg_list .data_col ") .eq(0) .children() .find(".xg_img ") .eq(0) .hide(); })($("#rf1798_07a0989e53e314c61")); (function (root) { root.find(".xg_list>div>.data_col ").each(function () { var _this = $(this).children(); _this.next().hide(); _this.find(".xg_img ").eq(1).hide(); _this .find(".xg_img ") .eq(0) .click(function () { root.find(".xg_list>div>.data_col>.row:odd").hide(); root .find(".xg_list>div>.data_col>.row:even") .find(".xg_img:even") .show(); root .find(".xg_list>div>.data_col>.row:even") .find(".xg_img:odd") .hide(); _this.next().show(); $(this).hide(); $(this).parent().next().children().show(); }); _this .find(".xg_img ") .eq(1) .click(function () { root.find(".xg_list>div>.data_col>.row:odd").hide(); _this.next().hide(); $(this).hide(); $(this).parent().prev().children().show(); }); }); root.find(".xg_list .data_col ").eq(0).children().next().show(); root .find(".xg_list .data_col ") .eq(0) .children() .find(".xg_img ") .eq(1) .show(); root .find(".xg_list .data_col ") .eq(0) .children() .find(".xg_img ") .eq(0) .hide(); })($("#rf1798_05b40b94fa31adfdf")); $(function () { tab.init("if17980dab4c268ab55b800"); var getcount = 10; var getindex = setInterval(function () { var tabselectdefault = $("#if17980dab4c268ab55b800 .xg_tab_tl-select"); if (getcount-- <= 0 || $(tabselectdefault).length <= 0) { clearInterval(getindex); return; } tab.changeitem(tabselectdefault); }, 300); }); (function (root) { root.find(".xg_list>div>.data_col ").each(function () { var _this = $(this).children(); _this.next().hide(); _this.find(".xg_img ").eq(1).hide(); _this .find(".xg_img ") .eq(0) .click(function () { root.find(".xg_list>div>.data_col>.row:odd").hide(); root .find(".xg_list>div>.data_col>.row:even") .find(".xg_img:even") .show(); root .find(".xg_list>div>.data_col>.row:even") .find(".xg_img:odd") .hide(); _this.next().show(); $(this).hide(); $(this).parent().next().children().show(); }); _this .find(".xg_img ") .eq(1) .click(function () { root.find(".xg_list>div>.data_col>.row:odd").hide(); _this.next().hide(); $(this).hide(); $(this).parent().prev().children().show(); }); }); root.find(".xg_list .data_col ").eq(0).children().next().show(); root .find(".xg_list .data_col ") .eq(0) .children() .find(".xg_img ") .eq(1) .show(); root .find(".xg_list .data_col ") .eq(0) .children() .find(".xg_img ") .eq(0) .hide(); })($("#rf1798_0e6f33b8f2da29422")); $(function () { menu($("#if179800a4267fa4b795f79")); }); (function (root) { /*LayoutRow*/ $(function () { $("#xg_header").css({ position: "fixed", top: 0, left: 0, "z-index": "9999", width: "100%", }); }); /*LayoutRow*/ })($("#rf1798_0a904198c4952bbc9"));