abouolia / sticky-sidebar

😎 Pure JavaScript tool for making smart and high performance sticky sidebar.
https://abouolia.github.io/sticky-sidebar/
MIT License
2.23k stars 489 forks source link

How call public methods for the Sticky Sidebar jQuery version ? #91

Open nutika88 opened 5 years ago

nutika88 commented 5 years ago

How can I call public updateSticky() methods for the jQuery version ?

var sidebar = $('.sidebar').stickySidebar({
    topSpacing: 60,
    bottomSpacing: 60
});

// This is not working for me
sidebar .updateSticky();
engvie commented 5 years ago

I'm trying to read the plugin code and find a way to do this but I can't see how.

jarred-cz commented 5 years ago
var sidebar = $('.sidebar').stickySidebar({
    topSpacing: 60,
    bottomSpacing: 60
});

// update 
sidebar.stickySidebar('updateSticky');

// destroy
sidebar.stickySidebar('destroy');
alienpr84 commented 4 years ago

please remove the blank space:

// update sidebar.stickySidebar('updateSticky');

// destroy sidebar.stickySidebar('destroy');