Author Topic: Image custom field, how to change css of image selected?  (Read 1084 times)

kerman

  • Beginner
  • *
  • Posts: 5
Image custom field, how to change css of image selected?
« 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.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27778
  • Always on vacation
    • Jenkin Hill Internet
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.8.4.10335 on Joomla 3.9.19 PHP 7.3.18

kerman

  • Beginner
  • *
  • Posts: 5
Re: Image custom field, how to change css of image selected?
« Reply #2 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.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4341
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Image custom field, how to change css of image selected?
« Reply #3 on: February 22, 2018, 18:47:52 pm »
Hi,
To use same style as the Size (S, M, L ...)  add CSS in your template:
Code: [Select]
.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;
}

kerman

  • Beginner
  • *
  • Posts: 5
Re: Image custom field, how to change css of image selected?
« Reply #4 on: February 22, 2018, 19:00:08 pm »
Thanks!

Working.