Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Foundation 6 have a way to stop link's from being followed (like when opening reveal modals)

I'm using Foundation 6's "Reveal" to create modals. When I use a reveal trigger on a link that has a href, the modal pops up but then the page goes to the link as well. I only want it to go to the link if there is no JS, it's also for SEO.

I've checked the Reveal (http://foundation.zurb.com/sites/docs/reveal.html) and Foundation's javascript utilities (http://foundation.zurb.com/sites/docs/javascript-utilities.html) without any luck.

like image 359
Tim Avatar asked Nov 25 '25 17:11

Tim


1 Answers

Try something like the following.

$('[data-open]').on('click', function(e) {
  e.preventDefault();
});
like image 161
Gavin Bruce Avatar answered Nov 27 '25 17:11

Gavin Bruce



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!