[Help] How to unstick a sticky element #1433
-
Is there a way to un-stick a sticky element previously initialized with something like:
There are some situations (when reflowing content on viewport resizing, for example) when previously sticky elements need not to be sticky anymore. There doesn't seem to be any behaviour to do just that (or I haven't been able to find it in the docs). |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I think |
Beta Was this translation helpful? Give feedback.
-
I've tried that, but it doesn't seem to do anything. Setting 'debug' to true and calling the 'destroy' behavior doesn't print any message on the console (should output 'Destroying previous instance' according to the sticky module sources). |
Beta Was this translation helpful? Give feedback.
-
Nevermind, it works, I was calling the 'destroy' behavior at the wrong time, before even initializing the element with .sticky({ ... }) ! |
Beta Was this translation helpful? Give feedback.
I think
$('.ui.sticky').sticky("destroy");
is enough