[SOLVED] Make a Tile a Link?

Get help with using Metro 4 components
Post Reply
shnar
Posts: 6
Joined: Mon Nov 26, 2018 12:52 pm
Status: Offline

[SOLVED] Make a Tile a Link?

Post by shnar » Wed Nov 28, 2018 3:19 pm

I have a need that to make a Tile a link to another page. I added some javascript code on the onclick event to navigate to the page and that works fine, but it's not acceptable to the client since they want to "right-click, open-in-new-tab". I tried adding an <a> tag surrounding the <div data-role="tile"> tag, but that caused all sorts of problems (tiles were laying on top of tiles). I tried adding the <a> tag as the first child of the tile div, and this gave me half the desired effect. All the content (text and images) of the tile was a link, but the "whitespace" of the tile was not. So the links only worked if they right-clicked on the text, as opposed to any area of the tile.

Is there a way to make the entire tile a link?

-shnar

User avatar
olton
Site Admin
Posts: 133
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Wed Nov 28, 2018 4:20 pm

Code: Select all

<a href="..." data-role="tile">...</a>

shnar
Posts: 6
Joined: Mon Nov 26, 2018 12:52 pm
Status: Offline

Post by shnar » Thu Nov 29, 2018 7:26 pm

Worked great, thanks.

-shnar

Post Reply