Menu icon Foundation
Foundation errors on templated content

I'm using mustache to render templates for a single page application, and I'm noticing a few issues.

The main one is that dropdown buttons that are rendered after the page loads generate an error when hovered over: Uncaught TypeError: Cannot read property 'is_hover' of undefined

Is there a method I need to call after a post-page-load addition of Foundation components to "re-init"?

javascriptjsmustacheSPA

I'm using mustache to render templates for a single page application, and I'm noticing a few issues.

The main one is that dropdown buttons that are rendered after the page loads generate an error when hovered over: Uncaught TypeError: Cannot read property 'is_hover' of undefined

Is there a method I need to call after a post-page-load addition of Foundation components to "re-init"?

Rafi Benkual over 5 years ago

In Foundation 5 you can just call
Javascript
$(document).foundation();

again. It will ignore everything that already had an init function active.

You can also target one element like:

 $(dropdown).foundation();