i have implemented a jquery for fix header when user scrolls down the header will get fix position. But it is working in all browser except ie8. could anyone suggest the correct way.
$(document).ready(function()
{
$(document).scroll(function()
{
var window_y = $(window).scrollTop();
var header_h = $('.header').height();
if(window_y > header_h)
{
$(".header").addClass('fixed');
}
else
{
$(".header").removeClass('fixed');
}
});
});
Working reference is here.
try this and this will work fine or also you can give fixed height of header without make
variable of header pls try first console
let me know if you have any issue when you try this