Menu icon Foundation
Use interchange with href

Hi community!

Do you know if it is possible to use the interchange module with links (href) ?

I performed this test, but I get no result :(

<a data-interchange="[name-small.jpg, (small)], [name-large.jpg, (large)]">content</a>

foundation interchange link href

Hi community!

Do you know if it is possible to use the interchange module with links (href) ?

I performed this test, but I get no result :(

<a data-interchange="[name-small.jpg, (small)], [name-large.jpg, (large)]">content</a>
Andrew Lahser over 5 years ago

Hi,

I'm new too, so take this as a part guess. I think it is working, just not as you are hoping. I think the browser sees this:

<a data-interchange="[name-small.jpg, (small)], [name-large.jpg, (large)]" style="background-image:url(name-small.jpg)">content</a>

So, it is not adding an href, but rather, a style attribute to your a tag.

Also, I think your data-interchange might need a "default" parameter.

Good luck.
Andrew

Karl Ward over 5 years ago

It would be awesome to use interchange with links, and I requested this in Github several months ago:
https://github.com/zurb/foundation/issues/3833

Unfortunately some @ghaida misinterpreted- and closed the post.

I might take a look into this myself at some point ...