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

prevent the #zc_header from being added infinitely #1

Merged

Conversation

tmack8001
Copy link
Contributor

Since there are two different .pico-nav elements in the page source (original one simply hidden) the jquery method $el.insertAfter($target) will duplicate the $el and add it to each available $target nodes that isn't the original $el in the document.

This lead to the sticky header upon adding to not be able to be "removed" simply by removing the class .zc_sticky_header from it...

Before
scrolling down to the bottom and back up produces several copies of the intended sticky header which is to show when the user scrolls the recipe stats out of view though persists at the top of the experience for ever once it appears
image
image

After
expected behavior, there is only one element of #zc_header regardless of amount the user scrolls
image
before and after the sticky stats header appears with the fixed code
image

…) to two different parent .pico-nav elements
@tmack8001
Copy link
Contributor Author

haven't checked, but this also might fix the issue I have on mobile where the content randomly disappears, haven't had time to debug that one yet though

@Justin-Credible Justin-Credible merged commit 81f713f into Justin-Credible:master Dec 13, 2021
@Justin-Credible
Copy link
Owner

Sweet! Thanks for the thorough write up as well!

Justin-Credible added a commit that referenced this pull request Dec 13, 2021
@tmack8001
Copy link
Contributor Author

The recipes I was looking at yesterday on my phone that had an issue with just turning blank after scrolling around seems to be fixed.

Maybe the browser I was using didn't like when having multiple of the same element id tags or something...

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.

2 participants