Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StickySidebar not updating after update html content inside #128

Open
NicoxDJ opened this issue Jun 24, 2021 · 2 comments
Open

StickySidebar not updating after update html content inside #128

NicoxDJ opened this issue Jun 24, 2021 · 2 comments

Comments

@NicoxDJ
Copy link

NicoxDJ commented Jun 24, 2021

So i'm using the script in 2 divs

<div id="sticky-sidebar" class="summaryShortContainer column large-4 text-white text-14 margin-top-45 padding-0 ">
    <div class="sidebar__inner">

With this code initialization:

<script type="text/javascript">
    $(document).ready(function () {
        $('#sticky-sidebar').stickySidebar({
            innerWrapperSelector: '.sidebar__inner',
            topSpacing: 16,
            bottomSpacing: 16,
            minWidth: 1023
        });
    });
</script>

So far is good, everything seems to work.
But after i update the sidebar with new information via jQuery and update it:

$('.summaryShortContainer').html(data);

var sidebar = $('#sticky-sidebar').stickySidebar({
    containerSelector: '#sticky-sidebar',
    innerWrapperSelector: '.sidebar__inner',
    minWidth: 1023,
    resizeSensor: true,
    topSpacing: 16,
    bottomSpacing: 16,
});
sidebar.stickySidebar('updateSticky');

It updates the information, removes the .sidebar__inner styles and while moving sets #sticky-sidebar class is-affixed and style height: 0px; position: relative;, but .sidebar__inner tags are empty.

No matter what i do, just nothing. Not even a console error.
What i'm doing wrong?

@hacmak18
Copy link

I am also facing the same issue. when i call updateSticky()

style is set as relative but not updated as fixed.

did you found any solution?

@NicoxDJ
Copy link
Author

NicoxDJ commented Jul 15, 2021

@hacmak18 no, i didn't found how to update it.
I just change the update class. I update everything inside .sidebar__inner so i don't have to touch it's settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants