VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: kerman on February 22, 2018, 12:22:58 PM

Title: Image custom field, how to change css of image selected?
Post by: kerman on February 22, 2018, 12:22:58 PM
Hi!

I have a problem with image custom field.

I already hidden the radio button, so only the image is shown. But when you click in the image nothing happens, so the user doesn't know if it's already selected.

IS there a way with css so I can change the css property of the image when it has been selected?

My Joomla version is 3.8.5
Virtuemart version: 3.2.12
PHP: 7.0.27
Livesite: https://goo.gl/Zr4bX4

Thanks.
Title: Re: Image custom field, how to change css of image selected?
Post by: jenkinhill on February 22, 2018, 13:12:17 PM
See http://forum.virtuemart.net/index.php?topic=128401.0
Title: Re: Image custom field, how to change css of image selected?
Post by: kerman on February 22, 2018, 16:35:56 PM
Ok, sorry.

My Joomla version is 3.8.5
Virtuemart version: 3.2.12
PHP: 7.0.27
Livesite: https://goo.gl/Zr4bX4

Thanks.
Title: Re: Image custom field, how to change css of image selected?
Post by: Studio 42 on February 22, 2018, 18:47:52 PM
Hi,
To use same style as the Size (S, M, L ...)  add CSS in your template:
.product-field-type-M  input[type="radio"]:checked+img{
    border: 2px solid #555555 !important;
    box-shadow: 0 0 4px rgba(10, 10, 10, 0.5);
    color: #474949;
}
Title: Re: Image custom field, how to change css of image selected?
Post by: kerman on February 22, 2018, 19:00:08 PM
Thanks!

Working.