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

I need that these header_top will be hidden at start of page

本文关键字:隐藏 开头 top header      更新时间:2023-09-26

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

最好添加一个css样式:

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

然后用javascript 显示