I am trying to create clickable button which has 4 different actions depending on which quadrant of the image is clicked. I have sliced my image into 4 parts (upper left, upper right, lower left and lower right). I want the image to look seemless as a single image, composed of 4 separate images.
I have tried making 4 image components with a different action for each one, but I cannot get them to align in a 2x2 grid with no spacing in between (so the 4 images look like 1, but each have own action).
I tried making a glide table of 4 the images and making a list (as tiles) from those. With some CSS, i removed the spacing between them. But not sure how to make each item in the list have a different action, or pick up the item number in the list in the action to determine which was clicked.
There are probably some easy solutions that I am overlookingâŚ
Tiles can be set with either larger or smaller padding, but I donât remember if it eliminates all padding, or if there is a small separation between tiles. If not, then CSS maybe your only option. Worth trying though to see if you can avoid using CSS.
As for actions, assuming you have an image column and another column to identify the each row (such as a number), you can create a custom action on your inline list with an IF statement to perform a different action based on the value in that row identifier column.
@Jaime- i have seen the independent screen configuration per item, but cannot locate that option nowâŚi used the response by @Jeff_Hager to solve this. Adding the column id to each image row and then 4 if statements in the action did the trick.
Thank you!
regarding the first part of my question- how can i get 4 image components to line up in a 2x2 grid with no spacing ? I have tried some CSS,
There should be a padding option in the tiles setting. Thereâs a tight option and a loose option. I think the loose option is the default. Like I said, Iâm not sure how tight the padding gets, so it might not work exactly how you want. Iâm not by a computer to test it at the moment.
But was there any problem with my approach? When I say ânot 100% tight so I had to do more CSSâ Iâm referring to the version when there is no CSS. It has a bit of padding and border-radius so I just set them to zero. Can you tell me why we need the margins here? Thanks a lot.
I use margins because they allow negative values to overlap a larger selection area than the image. I did a trial error on the environment on mobile and tablet. From the tablet it will be clear and why some parts use px or %. Using % will make the second line image overlap with the first line and so on.
Does the use of tricks with height also apply to tablets? I havenât tried it.
Thank you for sharing.