$(function () { //slide $(".hv-area").hover(function () { $(this).find(".sld-area").stop().slideToggle("fast"); }); //top ads $(".box > a").hover(function () { $(this).parents(".box").find("a").eq($(this).index()).fadeIn("fast").siblings().fadeOut(); var o = $(this).parents(".box")[0]; if (o.t) { clearInterval(o.t); o.t = undefined; o.index = $(this).index(); }; }, function () { var o = $(this).parents(".box")[0]; o.anment(); }).mousemove(function () { var o = $(this).parents(".box")[0]; if (o.t) { clearInterval(o.t); o.t = undefined; o.index = $(this).index(); } }); function dong(obj) { var j = $(obj).find("a").length; obj.index += 1; if (obj.index > j - 1) { obj.index = 0; }; $(obj).find("a").eq(obj.index).fadeIn("fast").siblings().fadeOut(); } var list = $(".box"); for (var k = 0; k <= list.length - 1; k++) { list[k].my = k; list[k].index = 0 list[k].t = 0; list[k].anment = function () { var _this = this; _this.t = setInterval(function () { dong(_this); }, 4000); }; list[k].anment(); }; //tab $(".tab-move ul li").not(".lk-bt").hover(function () { $(this).addClass("current").siblings().removeClass("current"); $(this).parent("ul").next(".tab-cont").find(".sh-ct:eq(" + $(this).index() + ")").show().siblings().hide(); }); // $(".mode5 p a").hover(function () { $(this).addClass("current").siblings().removeClass("current"); $(this).parent("p").next("div").find("ul:eq(" + $(this).index() + ")").show().siblings().hide(); }) //slide nav $(".item").hover(function () { $(this).find(".det-nav").show(); }, function () { $(this).find(".det-nav").hide(); }); //banner var sWidth = $(".banner-area").width(); var len = $(".banner-area ul li").length; var index = 0; var picTimer; var btn = "
"; for (var i = 0; i < len; i++) { btn += ""; } $(".banner-area").append(btn); $(".banner-area .btn span").mouseover(function () { index = $(".banner-area .btn span").index(this); showPics(index); }).eq(0).trigger("mouseover"); $(".banner-area ul").css("width", sWidth * (len)); $(".banner-area").hover(function () { clearInterval(picTimer); }, function () { picTimer = setInterval(function () { showPics(index); index++; if (index == len) { index = 0; } }, 5000); }).trigger("mouseleave"); function showPics(index) { var nowLeft = -index * sWidth; $(".banner-area ul").stop(true, false).animate({ "left": nowLeft }, 200); $(".banner-area .btn span").removeClass("on").eq(index).addClass("on"); }; //choose $(".tab-choose li").click(function () { $(this).addClass("on").siblings().removeClass("on"); }); //online $(".online-pn").mouseover(function () { $(this).stop(); $(this).animate({ left: 0 }, 50); }) $(".online-pn").mouseout(function () { $(this).stop(); $(this).animate({ left: -170 }, 50); }); //choose tab $(".cut-bt").click(function () { $(this).parent(".cut").find(".chg-over").toggle("fast"); $(this).parent(".cut").siblings(".cut").find(".chg-over").hide(); }); $(".chg-over").click(function () { $(this).hide(); $(this).parent(".cut").find("span").text(); }); $(".chg-over").hover(function () { },function(){ $(this).hide(); }); //go top var t = 0; $(window).scroll(function () { t = $(window).scrollTop(); }) $(".go-top").click(function () { var move = setInterval(function () { t -= 200; $(window).scrollTop(t); if (t < 0) { clearInterval(move) } }, 30) return false; }); //prev next $(".scroll-main").hover(function () { $(this).find(".btns").show(); }, function () { $(this).find(".btns").hide(); }) //up and down var rh = $(".notice li").height(); var rn = $(".notice li").size(); $(".notice").height(rh * rn); var ri = 0; function rmove() { ri++; $(".notice").stop().animate({ "top": -ri * rh }, 200); if (ri == rn) { $(".notice li").first().clone().appendTo($(".notice")); $(".notice").height(rh * (rn + 1)); $(".notice").stop().animate({ "top": -ri * rh }, function () { $(".notice li").last().remove(); $(".notice").css("top", "0"); ri = 0; }); } } var ra = setInterval(rmove, 5000); $(".notice li").hover(function () { clearInterval(ra); ri = $(this).index(); if (ri < rn) { $(".notice").stop().animate({ "top": -ri * rh }); } else { $(".notice").stop().animate({ "top": ri * rh }); } }, function () { ra = setInterval(rmove, 5000); }) //right nav $(".skip a").click(function () { var ti = $(this).index(); $(this).addClass("on").siblings().removeClass("on"); var selfHeight = $(".fl-area").find("div[tags='scroll-focus']").eq(ti).offset().top; //$('body,html').stop().animate({ scrollTop: selfHeight }, 500); $(window).scrollTop(selfHeight); //return false; }); //hover $(".mos").hover(function () { $(this).addClass("hov"); }, function () { $(this).removeClass("hov") }); $(".zy-tit li").click(function () { $(this).addClass("on").siblings().removeClass("on"); $(".zy-tab").find(".zy-main:eq(" + $(this).index() + ")").show().siblings().hide(); }); //search $(".search-box").hover(function () { var now = $(this) $(this).find('ul').stop().slideDown(); $(this).find("li").click(function () { now.find("span").html($(this).html()).attr("typeVal", $(this).attr("data")); $(this).parent('ul').hide(); }) }, function () { $(this).find('ul').stop().slideUp(); }); }); function loginFormEvent(th) { //login $(th).unbind("keypress"); $(th).bind("keypress", (function (e) { var key = window.event ? e.keyCode : e.which; if (key.toString() == "13") { AjaxUserLogin(27); return false; } })); }; //guide //next div function nextPages() { var arr = document.getElementById('tdBjzbsx').getElementsByTagName('div'); for (g = 0; g < arr.length - 1; g++) { if (arr[g].style.display == "block" || arr[g].style.display == "") { arr[g].style.display = "none"; arr[g + 1].style.display = "block"; window.location.href = "#" + arr[g + 1].id; return; } } } //prev div function topPages() { var arr = document.getElementById('tdBjzbsx').getElementsByTagName('div'); for (g = 11; g >= 0; g--) { if (arr[g].style.display == "block" || arr[g].style.display == "") { arr[g].style.display = "none"; arr[g - 1].style.display = "block"; window.location.href = "#" + arr[g - 1].id; break; } } } function hidediv() { $("#yd").remove(); $("#tdBjzbsx").remove(); $(".cover-main").remove(); window.Storage.Set("MX_view", "Guide", "1"); } // function topPages() { var arr = document.getElementById('tdBjzbsx').getElementsByTagName('div'); for (g = 11; g >= 0; g--) { if (arr[g].style.display == "block" || arr[g].style.display == "") { arr[g].style.display = "none"; arr[g - 1].style.display = "block"; window.location.href = "#" + arr[g - 1].id; break; } } } function hidediv() { $("#yd").remove(); $("#tdBjzbsx").remove(); $(".cover-main").remove(); window.Storage.Set("MX_view", "Guide", "1"); var Guide = window.Storage.Get("MX_view", "Guide"); }