// javascript document $(function () { $(".totop").click(function () { $("html, body").stop().animate({ scrolltop: 0 }, 1000) }); $(".prokk").css({ "top": ($(window).height() - 607) / 2 + "px" }) $(".proclose").click(function () { $(".prohbj").hide(); $(".prokk").hide(); }) $(".nav ul li").hover(function () { $(".nav ul li .navul").hide(); if (!$(this).find(".navul").is(":animated")) { $(this).find(".navul").slidedown() } }, function () { $(this).find(".navul").slideup(300) }) $(".navulm").each(function () { var size = 0; for (var i = 0; i < $(this).find(".navli").size(); i++) { if (parseint(size) < parseint($(this).find(".navli").eq(i).attr("rel"))) { size = $(this).find(".navli").eq(i).attr("rel") } } $(this).css({ "width": parseint(size) * 8 + 30 + "px" }) //$(this).find(".navli").css({ "width": parseint(size) * 7 + "px" }) }) if ($(".sprobj").attr("bag") != "") { $(".products").css({ "background": "url(" + $(".sprobj").attr("bag") + ") no-repeat center fixed" }) } $(".a1le_1 img").attr("src", $(".a1le_2 a").eq(0).find("img").attr("src")); $(".a1le_2 a").eq(0).addclass("cona"); $(".a1le_2 a").hover(function () { $(".a1le_2 a").removeclass("cona"); $(this).addclass("cona"); $(".a1le_1 img").attr("src", $(this).find("img").attr("src")); }, function () { }) if ($(".jqzoom").length > 0) { $(".jqzoom").imagezoom(); } $(window).scroll(function () { var gun = $(document).scrolltop(); //这个方法是当前滚动条滚动的距离 if (gun > 0) { $(".top").addclass("toph") $(".topbj").css({ "height": "70px" }) } else { $(".top").removeclass("toph") $(".topbj").css({ "height": "92px" }) } }) $(".proshowcrcli").eq(0).show(); $(".proshowcrtop .proshowcrtopn").click(function () { $(".proshowcrtop .proshowcrtopn").removeclass("vas") $(this).addclass("vas") $(".proshowcrc .proshowcrcli").hide() $(".proshowcrc .proshowcrcli").eq($(this).index()).show() }) $(window).scroll(function () { if ($(".proshowcl").length > 0) { var asrd = 0 if ($(".proshowc").offset().top - $(".top").height() < $(document).scrolltop()) { asrd = $(document).scrolltop() - $(".proshowc").offset().top + $(".top").height(); if (asrd > $(".proshowc").height() - $(".proshowcl").height() + 2) { asrd = $(".proshowc").height() - $(".proshowcl").height() + 2 } $(".proshowcl").stop().animate({ "top": asrd }) } else { $(".proshowcl").stop().animate({ "top": 0 }) } } }) $(window).scroll(function () { if ($(".pronav").length > 0) { var asrd = 0 if ($(".products").offset().top - $(".top").height() < $(document).scrolltop()) { asrd = $(document).scrolltop() - $(".products").offset().top + $(".top").height(); if (asrd > $(".products").height() - $(".pronav").height() + 2) { asrd = $(".products").height() - $(".pronav").height() + 2 } $(".pronav").stop().css({ "top": asrd }) } else { $(".pronav").stop().css({ "top": 0 }) } } }) $(window).scroll(function () { if ($(".comnav").length > 0) { var asrd = 0 if ($(".companyshow").offset().top - $(".top").height() < $(document).scrolltop()) { asrd = $(document).scrolltop() - $(".companyshow").offset().top + $(".top").height(); if (asrd > $(".companyshow").height() - $(".comnav").height() + 2) { asrd = $(".companyshow").height() - $(".comnav").height() + 2 } $(".comnav").stop().css({ "top": asrd }) } else { $(".comnav").stop().css({ "top": 0 }) } } }) $(".banner_mouse").click(function () { var top_li = $(".topxs").position().top; $('body,html').animate({ scrolltop: top_li - 90 }, 1000) }) }) $(window).load(function () { if ($(".magicthumb").length > 0) { $(".magicthumb").lightbox({ fixednavigation: true }); } })