我需要将这些header_top隐藏在页面的开头

时间:2013-08-30 06:44:27

标签: javascript jquery header styling

我需要在页面开头隐藏这些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'});
      });
    }
  });

1 个答案:

答案 0 :(得分:0)

最好是添加css样式:

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

然后用javascript显示它

相关问题