Sticky '_calc' Is Not An Available Method For This Element
I'm trying to invoke the recalculation of the sticky header when using Foundation 6. However everything i attempt returns We're sorry, '_calc' is not an available method for this
Solution 1:
I think the problem is that you're not calling $(document).foundation();
directly before the call to .foundation
with _calc
. In my tests, I've been able to replicate the error if I call $('#sticky').foundation('_calc', true);
before $(document).foundation();
is called. The issue stems from the fact that the sticky element hasn't been initialized when you're calling $('#sticky').foundation('_calc', true);
Fiddle where
$(document).foundation();
is called before.Fiddle where
$(document).foundation();
is called after.
I'm pretty sure the above is the cause. If not, please let me know.
Post a Comment for "Sticky '_calc' Is Not An Available Method For This Element"