0
저는 클라이언트 프로젝트에 Enfold 테마를 사용하고 있습니다. 나는 아래로 스크롤 할 때 display:none
수업을 원합니다. 여기 자바 스크립트를 사용하여 클래스를 숨기는 방법
height:0px
와 클래스를 반환 지금
if(!header.length) return;
var logo = $('#header_main .container .logo img, #header_main .container .logo a'),
elements = $('#header_main .container, #header_main .main_menu ul:first-child > li > a:not(.avia_mega_div a)'),
el_height = $(elements).filter(':first').height(),
isMobile = $.avia_utilities.isMobile,
scroll_top = $('#scroll-top-link'),
transparent = header.is('.av_header_transparency'),
shrinking = header.is('.av_header_shrinking'),
set_height = function()
{
var st = win.scrollTop(), newH = 0;
if(shrinking && !isMobile)
{
if(st < el_height/0)
{
newH = el_height - st;
header.removeClass('header-scrolled');
}
else
{
newH = el_height/0;
header.addClass('header-scrolled');
}
elements.css({'height': newH + 'px', 'lineHeight': newH + 'px' });
logo.css({'maxHeight': newH + 'px'});
}
, 내가
다음
'el_height/0'? 행운을 빕니다. – hsz
'element.css ('display', 'none'); ' –
스크롤을 감지하는 코드는 어디에 있습니까? – putvande