2013-08-30 54 views
-1
頁面

開始被隱藏,我需要這些header_top將在頁面開始被隱藏,請大家幫忙我需要這些header_top將在

var header_top = jQuery('#header-top-wrapper'); 
     var header_top_button = jQuery('#header-wrapper a.accordion').addClass('active'); 
     var header_top_height = header_top.height(); 
     header_top_button.click(function() { 
     if(header_top_button.hasClass('active')) { 
     header_top_button.removeClass('active'); 
     header_top.css({'overflow': 'hidden'}); 
     header_top.stop(true, false).animate({"height": "0px"}, 500, function(){ 
     });  
     } 
     else { 
     header_top.stop(true, false).animate({"height": header_top_height + "px"}, 500,   function(){ 
     header_top_button.addClass('active'); 
     header_top.css({'overflow': 'visible'}); 
     }); 
    } 
    }); 
+0

http://api.jquery.com/hide/ – CodingIntrigue

回答

0

最好是添加CSS樣式:

#header-top-wrapper { 
    display:none; 
} 

然後用javascript顯示它

+0

謝謝你的回答,我需要使用類似淡入的東西? – user2731812

+0

我已經解決了這些問題,謝謝 – user2731812

+0

是的,只要你想表現出來,你就可以這樣做: '$(「#header-top-wrapper」)。show();'或'$(「#header機頂-包裝「)淡入();' –