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

min_width option so element is always unstuck in smaller viewports #149

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

code418
Copy link

@code418 code418 commented Jan 12, 2016

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.

@samburgers
Copy link

+1

1 similar comment
@samuelsiau
Copy link

+1

@samburgers
Copy link

Hi, any plan to implement this?

@andrew-ireland
Copy link

+1

@samuelsiau
Copy link

+1

1 similar comment
@rahulv3a
Copy link

+1

@utilmind
Copy link

utilmind commented Apr 1, 2017

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
Copy link

utilmind commented Apr 1, 2017

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

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

Successfully merging this pull request may close these issues.

None yet

6 participants