$(function(){ // 控制字体多少 // var str= $("#P1").html(); // var html=""; // if(str.length>20){ // html=str.substring(0,20)+"..."; // } // else // { // html=str; // } // // // $("#P1").html(html); // $(".hualefttop>div").hover(function(){ // if($(".maskhuaxia").css("bottom") == "0") { // $(".maskhuaxia").stop().animate({"bottom": "100%"}, 500); // } else { // $(".maskhuaxia").stop().animate({"bottom": "0"}, 500); // } // }) $(".nav-icon").click(function(){ if($(".phone-pf").css("right")=="0px"){ $(".phone-pf").stop().animate({"right": "-100%"}, 500); }else{ $(".phone-pf").stop().animate({"right": "0"}, 500); } }); $(".phone-nav .phone-ul li").click(function(){ $(this).children("ul").slideToggle(); }); // 分页 $(".page>ul>li").click(function(){ $(this).addClass("active").siblings().removeClass("active"); }); // 华夏动态 $(".dynamicsub>a").click(function(){ var index=$(".dynamicsub>a").index(this); $(this).addClass("active").siblings().removeClass("active"); $(".fynamicdiv>div").eq(index).addClass("block").siblings().removeClass("block"); }); $(".surzhangtop").click(function(){ $(this).siblings().slideToggle(); $(this).find('em').toggleClass('cuo'); $(this).parent().siblings().children('.surzhangcont').slideUp(); $(this).parent().siblings().children('.surzhangtop').find('em').removeClass('cuo'); }); var height = 67; if (height > 60) { //$(".voiceul li .ayheight").css("height", "67px"); var state = 0; //这个位置要用预绑定 $(".hydspa").live("click", function () { if (state == 0) { $(this).parent().css("height", "auto").parents().siblings("li").children('.voice-cont').css("height", "67px"); $(this).addClass("cuo").parents().siblings("li").children('.hydspa').removeClass("cuo"); state = 1; } else { $(this).parent().css("height", "67px").parents().siblings("li").children('.voice-cont').css("height", "auto"); $(this).parents().siblings("li").children('.voice-cont').css("min-height", "107px"); $(this).removeClass("cuo").parents().siblings("li").children('.hydspa').addClass("cuo"); state = 0; } }); } });