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

Trigger issues #8

Closed
mogmachine opened this issue Jul 13, 2014 · 2 comments
Closed

Trigger issues #8

mogmachine opened this issue Jul 13, 2014 · 2 comments

Comments

@mogmachine
Copy link

From what I can tell the trigger fires when the trigger element enters the browser window, however I wish to fire they trigger when the trigger element leaves the window (when scrolling down). Is this possible?

I cannot set an numerical offset as the site is responsive so this changes.

I essentially am duplicating what Mashable do with their share buttons, ..the share buttons on are on the page below an article title, but when leave leave the page I want them to trigger headhesive. I have placed a #share-trigger below the share buttons,..although in retrospect just using the share buttons div would work if I could set it to trigger when it leaves the page.

Is this possible? ..thanks in advance.

@markgoodyear
Copy link
Owner

Currently it's not possible directly, but there a few ways you could achieve this:

  1. Add in an anchor tag where you want the trigger to be, and target that.
  2. Use some JS to get the bottom of the element, and pass that to Headhesive. I'm not sure if this will work well responsively, so the first solution may be best.

I like the idea of targeting the bottom of an element as well as the top, I'll look to add this into the plugin :)

@mogmachine
Copy link
Author

Thanks for getting back to me, ..I changed my logic around a bit, ..I had intended to have two Headhesive's on the page at different point, ..but have now compressed that down. Still loving the script, ..very nice. Thanks,

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

No branches or pull requests

2 participants