If I understood well the docs, I should be able to run sticky plugin from JS only, without extra markup in html like data-sticky-container or others.
I tried several times, still no luck, when initialized my
Here's the codepen: http://codepen.io/Nikolaus91/pen/QyYmjW
Just comment the JS part and watch top-bar reappear, console log is pure.
Source in the docs: http://foundation.zurb.com/sites/docs/sticky.html
I experienced the same issue with 6.1.2 . It seems the problem is coming from this line : when you don't have a parent element with the data-sticky-container attribute, a container is created using the data-container template option/attribute. This container is created using the .wrapInner() jQuery function, but is never attached into the document tree.
Rewriting those lines as this seems to fix the problem (I'm too lazy to do a PR, sorry :sweat:)
if($parent.lenth){
this.$container = $parent;
} else {
this.wasWrapped = true;
this.$element.wrap(this.options.container);
this.$container = this.$element.parent();
}
This is still an issue with Foundation 6.2.1. This JS results in the #sidebar element disappearing from the markup entirely.
var stickySidebar = new Foundation.Sticky($('#sidebar'), {
// options…
});
This appears to still be broken in 6.3.0. The fix from mlang38 fixed this for me.
@randmanrjr Then go ahead and make a PR !
=> https://akrabat.com/the-beginners-guide-to-contributing-to-a-github-project/
Since the PR is merged, should this ticket be marked closed?
👍
Most helpful comment
I experienced the same issue with 6.1.2 . It seems the problem is coming from this line : when you don't have a parent element with the
data-sticky-containerattribute, a container is created using thedata-containertemplate option/attribute. This container is created using the.wrapInner()jQuery function, but is never attached into the document tree.Rewriting those lines as this seems to fix the problem (I'm too lazy to do a PR, sorry :sweat:)