sticky-kit
sticky-kit copied to clipboard
min_width option so element is always unstuck in smaller viewports
A new option to disable the sticky behaviour based on viewport width
$(el).stick_in_parent({
min_width: 768,
});
Useful for some responsive layout requirements without the need to destroy and reinitialise.
+1
+1
Hi, any plan to implement this?
+1
+1
+1
I have implemented it myself. Not with class option, but with global quick variable:
var min_stickykit_width = 768; // minimum client width required the "Sticky-kit" to work.
// + modified the following line of code, right before "fixed = true;": // was: if (scroll > top) { // now: if (scroll > top && $(document).width() >= min_stickykit_width) {
And of course I detecting the device type and don't even loading jquery.sticky-kit.js for phones.