sticky-kit icon indicating copy to clipboard operation
sticky-kit copied to clipboard

Hi! I have a problem with recalc

Open CeSolo1Capitano opened this issue 9 years ago • 1 comments

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

CeSolo1Capitano avatar Jan 19 '16 09:01 CeSolo1Capitano

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 ...

carolinmoll avatar Dec 20 '16 10:12 carolinmoll