Closed wim-mertens closed 8 years ago
I have an instance where on a different screen size it requires a different topSpacing, like this:
`$(function () { if ($(window).width() < 1006) { $(".search-within-holder").sticky({ topSpacing: 92, bottomSpacing: 267 });
} else { $(".search-within-holder").sticky({ topSpacing: 156, bottomSpacing: 267 }); }
});`
Problem is, it only fixes the topSpacing on refresh. Is there any way it can be updated on resizing the window?
Try this: $( window ).resize(function() { $('#header').sticky('update'); });
$( window ).resize(function() { $('#header').sticky('update'); });
Worked like a charm, thanks!
I have an instance where on a different screen size it requires a different topSpacing, like this:
`$(function () { if ($(window).width() < 1006) { $(".search-within-holder").sticky({ topSpacing: 92, bottomSpacing: 267 });
});`
Problem is, it only fixes the topSpacing on refresh. Is there any way it can be updated on resizing the window?