Keyword

hover an image over item image

More
11 years 5 months ago #123905 by tomo
hover an image over item image was created by tomo
Hi,

How would I hover over a transparent image over the item image on this ?

Muchos Gracious!

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 5 months ago #123906 by Yiota
Replied by Yiota on topic Re: hover an image over item image
First of all you will have to add the transparent image somewhere in the code and specifically right under the <img> element of the itemImageBlock container.
Then with some css place the transparency right above the image.

You can ask your template developer/provider in order to help you with this.

Don't forget to use the K2 template overrides in order to make the modification required in the item.php file or the category_item.php file.

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #123907 by tomo
Replied by tomo on topic Re: hover an image over item image
thank you for your prompt response here is the code in item.php and the css - where would you put the transparent image and would css need editing?
Log in  or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 5 months ago #123908 by Yiota
Replied by Yiota on topic Re: hover an image over item image
Put a <span class="hoverImg"> </span> right under the <img> element in the code you have provided.

Then all else should be made with CSS.

Add to .itemImageBlock a, a position:relative;
and the css for the hoverImg

.itemImageBlock a span.hoverImg {opacity:0; width:100%; height:100%; display:block; position:absolute;top:0;left:0;background:#000;}
.itemImageBlock a:hover span.hoverImg {opacity:0.4;}

If you want to remove the current effect from your image, remove the css

.itemImageBlock:hover img{
-webkit-transform:scale(1.06);
-moz-transform:scale(1.06);
-ms-transform:scale(1.06);
-o-transform:scale(1.06);
transform:scale(1.06);}

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #123909 by tomo
Replied by tomo on topic Re: hover an image over item image
thank you for your help! I've done this on localhost and it works a treat!!

One last problem I have is it works on individual item page - but not on the category list... any ideas where I'd put <span class="hoverImg"></span> ??

Thank you for your help!

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 5 months ago #123910 by Yiota
Replied by Yiota on topic Re: hover an image over item image
Just locate the similar block of catItemImageBlock in category_item.php and put it right under the img of that block. Then adjust the css to work on the listing as well.

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #123911 by tomo
Replied by tomo on topic Re: hover an image over item image
Hi, yeah I tried that - but it doesn't seem to work - the <a class="itemImage" is different, in the item it reads <a class="modal" - would that have anything to do with it?
Log in  or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 5 months ago #123912 by Yiota
Replied by Yiota on topic Re: hover an image over item image
Keep both classes. Separate them with a space between them. The item needs the modal class so when the image is clicked to open in a modal window.

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #123913 by tomo
Replied by tomo on topic Re: hover an image over item image
Ignore last comment! I got it sorted now!! :)
Thank you for all your help!

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 5 months ago #123914 by Yiota
Replied by Yiota on topic Re: hover an image over item image
You are welcome.

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #123915 by tomo
Replied by tomo on topic Re: hover an image over item image
final question - which file do I put the <span class="hoverImg"></span> in for the homepage items?? Everything else is working!

Thanks!

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 5 months ago #123916 by Yiota
Replied by Yiota on topic Re: hover an image over item image
Since your homepage is a link to Latest items from category, you should put the span element in latest_item.php file of your overrides.

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #123917 by tomo
Replied by tomo on topic Re: hover an image over item image
Yeah - I put it here, doesnt seem to want to work - does it require a CSS edit?
Log in  or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 5 months ago #123918 by Yiota
Replied by Yiota on topic Re: hover an image over item image
Probably. Check if you have the css declarations for .itemImageBlock under different containers.

Do you have it on the live site so I can check it out?

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #123919 by tomo
Replied by tomo on topic Re: hover an image over item image
Hi!

Its all sorted thank you for your support and help on this

Much appreciated!

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 5 months ago #123920 by Yiota
Replied by Yiota on topic Re: hover an image over item image
You are welcome.

Please Log in or Create an account to join the conversation.