$(document).ready(function () { var index = undefined; $(".left li").on("click", function () { $(".active").removeclass("active"); $(".title img").prop("src", "image/icon-menu-more.png"); $(this).addclass("active"); $(this).find("img").prop("src", "image/icon-menu-active.png"); }); $(".top").on("click", function () { $('body,html').animate({ scrolltop: 0 }, 1000); }); $(".product .prod-show .prev").click(function () { $(".prod-show ul").find("li:first").appendto($(".prod-show ul")); }); $(".product .prod-show .next").click(function () { $(".prod-show ul").find("li:last").prependto($(".prod-show ul")); }); $(".product .prod-show .container ul li img").click(function () { $("div.show img").attr("src", $(this).attr("src")) }); $(".product .prod-tabs a").click(function () { $(".product .prod-tabs a").removeclass("over").eq($(this).index()).addclass("over"); $(".content").removeclass("over").eq($(this).index()).addclass("over"); }); $("#show ul li img").click(function () { $("div.bigimg img").attr("src", $(this).attr("src")) }); $(".more-prod a.prev").click(function () { $(".more-prod ul").find("li:first").appendto($(".more-prod ul")); }); $(".more-prod a.next").click(function () { $(".more-prod ul").find("li:last").prependto($(".more-prod ul")); }); $(".all a").click(function () { $("body").append("
"); $("#show").show() }); $(".product .content ul li").click(function () { $(".product .content ul li").removeclass("over") index = ($(this).index()); $("body").append("
"); $(".bigimg img").attr("src", $(this).find("img").attr("src")) $("#show").show() }); $("#show a.show_left").click(function () { if (index >= 1) { index = index - 1; } $(".bigimg img").attr("src", $(".product .content ul li").eq(index).find("img").attr("src")) }); $("#show a.show_right").click(function () { if (index <= ($(".product .content ul li").length - 2)) { index = index + 1; } $(".bigimg img").attr("src", $(".product .content ul li").eq(index).find("img").attr("src")) }); $("a.close").click(function () { $(".authority").remove(); $("#show").hide() }); $(window).bind("scroll", function () { $(document).scrolltop() > $(".left").offset().top ? $(".left div").addclass("fixed") : $(".left div").removeclass("fixed"); }) });