Is it possible to zoom (lightbox) featued images in questions and answers?

closed

Dear,
I installed the plugin and created a quiz. Cool Stuff.
But now I have a “major” issue: I need to be able to “zoom” the featured images in the questions as well as in the answers (a kind of lightbox). Can this be done and if so, how?
This is essential for the definitive choice of this plugin.
Many thanks and greetings,
Stephan Fischli

August 29, 2023 at 9:26pmStephan

Hi Stephan,
it would be possible to hook into HD Quiz to modify the featured image so that it’s a lightbox, but it is not possible to do so with the answers.

The image answers are selectable entities already – if you made it also a lightbox, then it could no longer be clicked to toggle that answer as selected.

From what I can tell, here are your options.

  1. We can turn the featured images into lightboxes, but leave the images in answers as is.
  2. Instead of a lightbox, perhaps we can do something like enlarging images on hover/mouseover. This way selecting answers still works as intended.
  3. You will need to find a different quiz plugin.

The easiest for you to implement is #2. To do option #2, you can add the following CSS to your site (easiest way is to select Appearance ⇾ Customize ⇾ Additional CSS).

.hdq_question img:hover{ transform:scale(1.5); z-index: 99999; } .hdq_question img { transition: all 300ms }

The above CSS will enlarge any image inside a quiz by 50% on hover. The most important part is transform:scale(1.5); where 1.5 means “1.5 times default size” – so feel free to play around with that number to find one that works best for you.

You can also add that code inside different media queries in order to set how much images zoom based on the user’s screen-width.

I hope that this is at the very least, able to point you in the right direction, and let me know if you need any clarification/more help on anything!

29 August 2023 — 17:43support admin Dylan

This thread has either been marked as complete or has been automatically closed due to inactivity. Please consider opening a new support thread for help.