Hi there.
I have multiple different sticky header bars that are to be active based on the page scroll. This works fine using the Trigger Selector, as soon as you reach a specific ID when scrolling through the page, a correlating header bar is activated.
The problem I’m having is that the previous header bar isn’t deactivated, resulting in divergent header bars overlapping. Since they are semitransparent and with different heights, this isn’t really good.
Now, I did find an option to render a specific header bar visible/invisible based on pixels via JavaScript but that’s not really optimal, since the height in pixels you have to scroll can vary a lot.
jQuery(function($){
$(window).scroll(function(){
var aTop = $('#hauptheader').height()+900;
if($(this).scrollTop()>=aTop){
$('#hauptheader').hide();
} else {
$('#hauptheader').show();
}
});
});
Is there an option to have an ID (e.g. “#zwo” trigger the .hide()?
I suck at JS…
Thanks in advance,
om.