Skip to content Skip to sidebar Skip to footer

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);

  1. Fiddle where $(document).foundation(); is called before.

  2. 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"