Menu icon Foundation
Load Reveal without data-open element?

I'd like to trigger a reveal through javascript instead of a data-open element. I can't figure out how to accomplish this.

Directly calling via $('#reveal_id').foundation('open') doesn't work.

 

Thanks for any help!

reveal

I'd like to trigger a reveal through javascript instead of a data-open element. I can't figure out how to accomplish this.

Directly calling via $('#reveal_id').foundation('open') doesn't work.

 

Thanks for any help!

Rafi Benkual over 1 year ago

That looks right - any JS errors? 
$('#element').foundation('open');

Christian Magill over 1 year ago

foundation.min.js:3 Uncaught ReferenceError: We're sorry, 'open' is not an available method for this element.

    at w.fn.init.e [as foundation] (foundation.min.js:3)

 

https://codepen.io/influencedesign/pen/wXGgwK

Rafi Benkual over 1 year ago

Looks you have not initialized foundation here.

 

That has to happen first to apply listeners to all the JS components 

 

https://codepen.io/rafibomb/pen/aKmdyx

Christian Magill over 1 year ago

Much thanks! I'll take a closer look at my implementation in project.

 

Thanks,