Hello,
I want to build a menu with graphical buttons. The buttons should be placed into the background of the a-tag so that I can alter the background-position on hover and active. To do this, I need to know how wide the image is, so that I can tell the a-tag to be that wide. I would do this with a small snippet call from within the wayfinder template chunk.
Is there already such a snippet oder should I code one myself?
Thanks for hints
Martin
Do you really need to know the width? Why not stack the button states vertically in the image, assuming the button height is fixed? Or use percentages for background positioning.
Heh, that’s actually my snippet. It won’t tell you the width/height of an image though, sorry.
Yeah, I knew it wouldnt be too hard to do, just didn’t want to code a snippet that already exists. Your code is very fine for me as a base.
Thank you
Martin