sticky-kit icon indicating copy to clipboard operation
sticky-kit copied to clipboard

min_width option so element is always unstuck in smaller viewports

Open code418 opened this issue 9 years ago • 8 comments
trafficstars

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.

code418 avatar Jan 12 '16 15:01 code418

+1

samburgers avatar Jan 19 '16 06:01 samburgers

+1

samuelsiau avatar Jan 21 '16 11:01 samuelsiau

Hi, any plan to implement this?

samburgers avatar Mar 09 '16 22:03 samburgers

+1

andrew-ireland avatar May 15 '16 10:05 andrew-ireland

+1

samuelsiau avatar May 16 '16 07:05 samuelsiau

+1

rahulv3a avatar Aug 11 '16 06:08 rahulv3a

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) {

utilmind avatar Apr 01 '17 01:04 utilmind

And of course I detecting the device type and don't even loading jquery.sticky-kit.js for phones.

utilmind avatar Apr 01 '17 01:04 utilmind