Menu icon Foundation
Tried to initialize "+name+" on an element that already has a Foundation plugin.

Hi

What's the proper way to reflow an ajax loaded reveal content, which contains other js plugin (abide, accordion, reveal...) without triggering the double-dipping warning?

$("#myreveal").html(data).foundation("open");
// this triggers a bunch of warning messages
$(document).foundation();

Or should I just ignore the warning?

Thanks

foundation 6.0.6Reflowreveal

Hi

What's the proper way to reflow an ajax loaded reveal content, which contains other js plugin (abide, accordion, reveal...) without triggering the double-dipping warning?

$("#myreveal").html(data).foundation("open");
// this triggers a bunch of warning messages
$(document).foundation();

Or should I just ignore the warning?

Thanks

Brian Tan over 1 year ago

Ok. Did this and down to just 1 reveal warning.

$("#myreveal").html(data).foundation().foundation("open");

Daniel about 1 year ago

Has there been any development on this? No warnings would be great.

Joel van den Hoven 9 months ago

@Brian, did you ever find a solution for this? I have the same problem.

I don't like to ignore the warning, so I was wondering if there is a way to check whether the element already has a foundation plugin or not.

Something like:

if ( !$.isFunction( myElement.foundation ) ) {
   myElement.foundation();
}

Any help is appreciated.

Hari Harker 8 months ago

I have raised this as a question in StackOverFlow - Link

Update :

I have resolved the issue. I had used 

$(document).foundation();

inside a <script> tag in my html page and also have used the same in my "app.js" file. Removing either of those statements fixed the warning.

 

Chris 3 days ago

I've got this same problem with ajax loaded content.   Has anyone figured out how to see if the element has a foundation plugin already enabled?  Joel - I think you're on the right track, but I couldn't get it to work.