// JavaScript Document $(".menu_li").hover(function(){ if($(this).find("a").size()>1){ $(this).find(".menu_cn").show(); $(this).find(".menu_a").addClass("menu_b"); } },function(){ $(this).find(".menu_cn").hide(); $(this).find(".menu_a").removeClass("menu_b"); }) // 下拉菜单效果 $(function(){ $(".tab .tab_li").hover(function(){ $(this).parent().find(".tab_li").removeClass("tab_am"); $(this).addClass("tab_am"); var cutNum=$(this).parent().find(".tab_li").index(this); $(this).parents(".tab").find(".tab_con").hide(); $(this).parents(".tab").find(".tab_con").eq(cutNum).show(); }) }); $(function(){ $(".tab2 .tab2_li").click(function(){ $(this).parent().find(".tab2_li").removeClass("tab2_am"); $(this).addClass("tab2_am"); var cutNum=$(this).parent().find(".tab2_li").index(this); $(this).parents(".tab2").find(".tab2_con").hide(); $(this).parents(".tab2").find(".tab2_con").eq(cutNum).show(); }) }); $(function(){ $(".tab3 .tab_li").click(function(){ $(this).parent().find(".tab_li").removeClass("tab_am"); $(this).addClass("tab_am"); var cutNum=$(this).parent().find(".tab_li").index(this); $(this).parents(".tab3").find(".tab_con").hide(); $(this).parents(".tab3").find(".tab_con").eq(cutNum).show(); }) }); // TAB-选项卡切换 function upMove(obj){ $(obj).next().find("ul").width($(obj).next().find("ul li").size()*140); var dom = $(obj).next(); dom.animate({ scrollLeft:-140+dom.scrollLeft() },400) }; function downMove(obj){ $(obj).prev().find("ul").width($(obj).prev().find("ul li").size()*140); var dom = $(obj).prev(); dom.animate({ scrollLeft:140+dom.scrollLeft() },400) }; // width 改为 height // scrollLeft改为 scrollTop // 上下滚动调休 $(".sele_bt").click(function(){ $(".sele_cn").hide(); $(this).parent(".select").find(".sele_cn").show(); }); $(".sele_cn li").click(function(){ $(this).parents(".select").find(".sele_bt").html($(this).html()); $(".sele_cn").hide(); }); $(".sele_cn li").hover(function(){ $(this).addClass("lihover"); },function(){ $(this).removeClass("lihover"); }); $(document).ready(function(){ $(".select").click(function(e){ e.stopPropagation(); $(".sele_cn").removeClass("hide"); }); $(document).click(function(){ if(!$(".dz_nr").hasClass("hide")){ $(this).find(".sele_cn").addClass("hide").css('display','none'); } }); }); // 下拉列表 select $(".zksq_bt").toggle(function(){ $(this).parent(".zksq").find(".zksq_cn").slideDown(); },function(){ $(this).parent(".zksq").find(".zksq_cn").slideUp(); }); //滑动展开 $(".zksq_bt2").toggle(function(){ $(this).parent(".zksq").find(".zksq_cn2").fadeIn(); },function(){ $(this).parent(".zksq").find(".zksq_cn2").fadeOut(); }); //渐隐渐现展开 $(".zksq_bt3").toggle(function(){ $(this).parent(".zksq").find(".zksq_cn3").show(); },function(){ $(this).parent(".zksq").find(".zksq_cn3").hide(); }); //直接显示 // 点击展开、收起 /* $(function(){ $(".top").animate({ //top:"0px", height:"100px", }.show()) }) $(".top p").click(function(){ $(this).parent(".top").slideUp() }) */ // var maxHeight = 0; // $(".ul_height li").each(function () { // if ($(this).height() > maxHeight) { // maxHeight = $(this).height(); // $(".ul_height li").css("height", maxHeight) // } // }); //alert("所有li中最高的是:" + maxHeight); var maxHeight = 0; $(".ul_height li").each(function () { if ($(this).height() > maxHeight) { maxHeight = $(this).height(); } $(this).css("height",maxHeight); }); // 获取同级中最高给其他负值 $(".position_fixed").css("top",$(window).height()-40); // 固定在窗口底部 position_fixed $(".da_p:first").show(); $(".da_ul i").click(function(){ $(".da_p").hide(); $(this).parent("li").find(".da_p").show(); });