sticky-kit
sticky-kit copied to clipboard
Hi! I have a problem with recalc
Hi! I have a problem with the recalc, this is my function
function stickyRassign() { var mq = window.matchMedia( "(min-width: 990px)" ); var headHei = $('.header').height(); var rassignCat = $('.rassegne').length;
if (rassignCat === 1) {
if (mq.matches) {
$(".rassign-category").stick_in_parent({
recalc_every: 1,
offset_top_element: headHei + 1
});
$(".date").stick_in_parent({
parent: '.list-category-rassign',
recalc_every: 1,
offset_top_element: headHei + 1
});
}
else {
$(".rassign-category").stick_in_parent({
recalc_every: 1,
offset_top_element: headHei + 55
});
$(".date").stick_in_parent({
parent: '.list-category-rassign',
recalc_every: 1,
offset_top_element: headHei + 1
});
}
}
}
to resize the window does not calculate the height of the header
this function is called in document.ready, window.resize and window.scroll
show an example is quite difficult.
Ty
Same Problem here. Even if we calculate the height of the element on window.resize and call sticky kit also on window.resize. Any suggestions? The Offset-Top-Value is not updated ...