Skip to content

Recalc after added HTML by ajax, doesn't recalc #157

Description

@R4YM3

Hi there,

I've got the following situation where stickykit won't recalc.
Am i doing something wrong or is this a bug?

// set stickykit
self.$element.stick_in_parent( { 'offset_top' : 70 } #);

// get html data by ajax
var $ajaxCommentsData = ajax.ajaxGet( $url, 'html' );

$ajaxCommentsData.success( function ( data ) {
    var $data = $(data);

    // place new html in (left column, which makes parent height larger)
    $leftColumn.append( $data );

    // recalc sticky caus of the new added html by ajax (right column is sticky)
    $(document.body).trigger("sticky_kit:recalc");
});

This doesn't work either

self.$element.stick_in_parent( { 'offset_top' : 70 }); //works
self.$element.parent().css( 'height', '5000px' ); //works
$(document.body).trigger("sticky_kit:recalc"); //doens't recalc

For what is worth, :detach does work

Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions