Post by Valder » Wed May 20, 2020 10:07 pm

Hi, everybody, can you please tell me if I want to implement this functionality?

All products from product['thumb'] are displayed through foreach in the category template. When hovering over the product picture, through hover and position: absolute, z-index, I want to replace the main picture - the first additional picture.
The main image is displayed using

Code: Select all

<?php echo $product['thumb']; ?>
in src in img tag.

How to output the additional image in the next tag img, what to implement?
Last edited by straightlight on Wed May 20, 2020 11:07 pm, edited 1 time in total.
Reason: Added code tags.

Newbie

Posts

Joined
Wed May 20, 2020 10:00 pm

Post by straightlight » Wed May 20, 2020 11:06 pm

This topic has now been moved to the OpenCart 2.0 Support > General Support section of the forum.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by paulfeakins » Thu May 21, 2020 5:42 pm

Valder wrote:
Wed May 20, 2020 10:07 pm
Hi, everybody, can you please tell me if I want to implement this functionality?
I don't know, do you want to?

Valder wrote:
Wed May 20, 2020 10:07 pm
All products from product['thumb'] are displayed through foreach in the category template. When hovering over the product picture, through hover and position: absolute, z-index, I want to replace the main picture - the first additional picture.
So you want to make it so that on the category page, when a user hovers over a product, its first additional image is displayed?

Well, you could indeed use the z-index, or the position to do it.

You would need to output both images in a <div> and set that div to overflow:hidden, then position one of the images outside the visible area. On hover you can then change it so the additional image is visible and the main image is outside the visible area.

Really if you aren't able to do this you should pay a developer such as ourselves or post a job in the Commercial Support Forum.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom
Who is online

Users browsing this forum: No registered users and 12 guests