$(function() { $(".reag-1 .prod-type .type-list a").click(function(){ var index = $(this).index(); $(".reag-1 .prod-type .type-list a").removeClass("active"); $(this).addClass("active"); $(".reag-1 .list-con .con").hide(); $(".reag-1 .list-con .con").eq(index).show(); }).eq(0).click(); $(".reag-1 .list-con .prod-list .list-item").hover(function(){ $(".reag-1 .list-con .prod-list .list-item .drop").stop(false,true); $(this).addClass("show"); $(this).find(".drop").slideDown(); },function(){ $(".reag-1 .list-con .prod-list .list-item .drop").stop(false,true); $(this).removeClass("show"); $(this).find(".drop").slideUp(); }); $(".reagsDet .intro_tab_list .tab a").click(function(){ var index = $(this).index(); $(".reagsDet .intro_tab_list .tab a").removeClass("active"); $(this).addClass("active"); $(".reagsDet .intro_tab_list .list_con .con").hide(); $(".reagsDet .intro_tab_list .list_con .con").eq(index).show(); }).eq(0).click(); var wW = window.innerWidth;// 手机窗口的宽度 if (wW <600){ $(".reag-1 .list-con .prod-list .list-item").unbind("mouseenter").unbind("mouseleave"); $(".reag-1 .list-con .prod-list .list-item .tag").click(function() { var index = $(".reag-1 .list-con .prod-list .list-item .tag").index($(this)); if ($(this).attr("class") == "tag active") { $(this).removeClass("active"); $(this).next(".drop").slideUp(); } else { $(".reag-1 .list-con .prod-list .list-item .tag").removeClass("active"); $(this).addClass("active"); $(".reag-1 .list-con .prod-list .list-item .drop").slideUp(); $(this).next(".drop").slideDown(); } }); } });