Visit our mobile site here (mobile view) Currently, I have set the margin-top of .main-content based on sticky-animation, which keeps the header fixed at the top on mobile. However, there is a div with a close button (X) that alters its height dynamically without changing the margin, causing an unsightly gap. Here's the JavaScript being used:
if (jQuery(window).width() < 425) {
$(function(){
$('.main-content').each(function(){
var headerHeight=$('.sticky-animate').height();
// headerHeight+=15; // maybe add an offset too?
$(this).css('margin-top',headerHeight+'px');
});
});
}
If anyone can suggest improvements to make it more adaptable, that would be greatly appreciated. The script for hiding the bar is as follows:
function Hide(HideID)
{
HideID.style.display = "none";
}
<div id="right-showing">
<a href="#" onclick="Hide(Bar);">X</a>
</div>
Looking forward to some assistance with this issue.