$(function() { (function() { var sup = $("#idxbanner"), pics = sup.find(".pics li"), curr_p = pics.eq(0), next_p = null, idxs = sup.find(".idxs li"), curr_i = idxs.eq(0), next_i = null, left = sup.find(".btns .left"), right = sup.find(".btns .right"), idx = 0, idx_m = pics.length - 1, tt = 0, delay = 5000; $(window).on("load", function() { idxs.hover(idxhoveron, function() {}); idxs.hover(function() { cleartimeout(tt) }, function() {}); sup.hover(banhoveron, banhoverout); sup.hover(function() { cleartimeout(tt) }, function() { if (pics.length > 1) { auto() } }); left.on("click", function() { btnclick(idxdec()) }); right.on("click", function() { btnclick(idxinc()) }); if (pics.length > 1) { auto() } }); function auto() { tt = settimeout(function() { fade(idxinc()) }, delay) } function fade(i) { cleartimeout(tt); curr_p.stop(false, true).fadeout(500); curr_p = next_p = pics.eq(i).stop(false, true).fadein(); curr_i.removeclass("on"); curr_i = next_i = idxs.eq(i).addclass("on"); auto() } function idxinc() { return idx === idx_m ? idx = 0 : ++idx } function idxdec() { return idx === 0 ? idx = idx_m : --idx } function banhoveron() { left.stop().animate({ "left": 0 }, 150); right.stop().animate({ "right": 0 }, 150) } function banhoverout() { left.stop().animate({ "left": -43 }); right.stop().animate({ "right": -43 }) } function btnclick(i) { fade(i) } function idxhoveron(elem) { cleartimeout(tt); idx = $(this).index(); fade(idx) } })(); $(".news-top li").hover(function(event) { $(this).addclass('current').siblings().removeclass('current'); var index = $(this).index(); $(".news-more").hide(); $(".news-more").eq(index).fadein(300); $(".news-main").hide(); $(".news-main").eq(index).show() }); fadeslide.init($(".indexslide")); window.onload = function(event) { var screenheight = window.screen.height; var browserheight = parseint($(window).height()); var headerheight = parseint($(".header").height()); if (event) { var useingheight = browserheight - headerheight } else { var useingheight = 670 } $(".b-slide").height(useingheight); $(".b-slide .item").height(useingheight); $('#indexslide').imagesloaded({ background: 'li' }, function() { settimeout(function() { houser($(".pro-box a").eq(0)) }, 300) }); jquery(".est-box").slide({ titcell: ".hd ul", maincell: ".img ul", autopage: true, effect: "left", autoplay: true, intertime: 5000, endfun: function(i) { $(".info dd").hide(); $(".info dd").eq(i).fadein() } }) }; function houser(elm) { elm.css({ "margin-top": "59px", "opacity": "1" }); temp = elm.next(); if (temp.length) { settimeout(function() { houser(temp) }, 200) } } $(".pro-box a").hover(function() { $(this).css({ "margin-top": "0px" }); $(this).addclass('showtext') }, function() { $(this).css({ "margin-top": "59px" }); $(this).removeclass('showtext') }); $(".icon-search").hover(function() { $(this).addclass('show'); $(this).find(".hs-input").focus() }, function() { $(this).removeclass('show') }); (function() { var li = $(".nav li"), div = $(".snav>div"), innavline = $("span.innavline"); $(li).hover(function() { index = $(this).index(); itleft = $(div).eq(index).css("left"); if (index == 3) { itwidth = 52 } else { itwidth = 84 } innavline.css({ "left": itleft, "width": itwidth + "px" }); show(index) }); $(".headrange").hover(function() {}, function() { $(".sunav").stop(true, false).fadeout() }).trigger("mouseleave"); function show(index) { if (index > 0 && index < 9) { $(".sunav").stop(true, true).fadein(); $(div).eq(index).find("dd").hover(function() { parentleft = parseint($(this).parents("div").css("left")); itleft = $(this).position().left + parentleft; itwidth = $(this).width() + 32; innavline.css({ "left": itleft, "width": itwidth + "px" }) }); $(div).eq(index).show().siblings("div").hide() } else { $(".sunav").stop(true, true).fadeout() } } })(); var navparent = $(".header"), navline = navparent.find(".navline"), navcurrent = navparent.find(".nav .current"); var initleft = navline.position().left, initwidth = navline.width(); navparent.find(".nav li").hover(function() { var navlinewidth = $(this).find("a").width(); var offsetli = $(this).position().left + 18; navline.css({ 'width': navlinewidth }).stop().animate({ 'left': offsetli }, 300) }); $(".headrange").hover(function() {}, function() { navline.css({ 'width': initwidth }).stop().animate({ 'left': initleft }, 300) }) });