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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
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.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

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

Users browsing this forum: Bing [Bot] and 45 guests