Hello,
I use the command below so that the top of the page is all white and only when scrolling appears a “box-shadow” line at the bottom. It worked fine, but when the page loads, this “box-shadow” appears for 1 second and then disappears until it scrolls. Would you correct the code so this does not happen?
Site: cloudrock.com.br/revenda-de-hospedagem
CSS
.x-navbar.mi-static-top {
box-shadow: none;
}
.x-navbar {
box-shadow: 0px 2px 6px 0px rgba(0,0,0,.12);
}
JS
jQuery(document).ready(function($) {
var $win = $(window),
$navbar = $('.x-navbar');
function staticNavbarOnTop() {
if ( $win.scrollTop() < 50 ) {
$navbar.addClass('mi-static-top');
} else {
$navbar.removeClass('mi-static-top');
}
}
staticNavbarOnTop();
$win.scroll( staticNavbarOnTop );
});