vincent-au
12 years agoAdept
Changing text links to buttons?
So our designers are working on some comps for our in-house custom skin. They want to change certain links, like "view all," and some others to buttons. Since the links are not part of an lia-butto...
- 12 years ago
This is feasible, I've outlined one approach:
1) Hide the link using CSS.
2) Add JS to the page that will look for the link that you want to modify (I'm assuming that you want to modify stock links, so you can't rebuild them from scratch), and add the class "lia-button lia-button-primary" (for primary buttons) or "lia-button lia-button-secondary" (for secondary buttons) to the "a" node. You might need to add some CSS to style the button correctly.
3) Once the JS has made the modification, display the link (using the same JS).
The point of hiding/showing the link is that if the page is slow and the JS takes time to run, the user won't see a link turn into a button, instead he'll just see a button appear.