Jump to content

Image hover effect only on linked images?

Go to solution Solved by Guest,

Recommended Posts

  • 2 weeks later...
  • 4 months later...
  • 4 weeks later...
  • 7 months later...

Although this question has already been answered, I figured I'd add a little code I luckily figured out while combining two codes together to get the full result I was looking for.

So, I have a few transitional (code block) images on my site (http://www.goffcreative.com), specifically the subscription image where the button transitions colors.

I came across this answer while looking for a resolution for hover roll-overs on linked IMAGES and GALLERIES only, however even my coded transitional images (which I didn't want to change) were affected by this code.

Anyhow, super-long story a little shorter, if you ONLY want images and gallery images that are linked to have the hover effect, use this:


img.thumb-image:hover {

opacity: 0.6; filter: alpha(opacity=60); }

If you don't have any code block links (you don't want affected) on your site, this isn't necessary.

Thanks @jasonvb for the original! You're awesome.

Link to comment
  • Solution

And somehow I posted the wrong code...

Okay, here's the real one. Seriously this time:


a:link img {
 opacity: 1.0;
 filter: alpha(opacity=100);
}

a:hover img.thumb-image {
 opacity: 0.6;
 filter: alpha(opacity=60); 
}

Link to comment
  • 1 year later...
  • 1 month later...
  • 10 months later...
  • 2 weeks later...
  • 2 years later...
  • 10 months later...

Ok I was searching of the same answer and was able to make an hover effect work so helping people who might want the same This is working for :
- images that are a link
- images in a summary block that are therefore a link by default 
- images in a blog area that are therefore a link by default

And not on :
- images in a gallery
- images that are not a link

.sqs-block-image a:hover img {
  filter: 
  grayscale(100%);
}

/*Image in a summary:  hover effect*/
.sqs-gallery-design-carousel .sqs-gallery-design-carousel-slide  a:hover img {
  filter: 
  grayscale(100%);
}

/*Image in a main blog page :  hover effect*/
.BlogList-item-image-link:hover {
  filter: 
  grayscale(100%);
}

🙂

 

Link to comment
  • 2 years later...

I think my question is along these lines, if it's not please point me in the right direction...

I'd like a drop shadow filter added when the various images are hovered over, but the images are placed sporadically throughout the site. I've tried listing the block IDs, separated by commas, but it doesn't work. Do I have to list the :hover animation separately for each image or can I just list it once and if so, how do I do so?

Here's what I have:
#block-03cb185697cf6cef5ae8:hover {filter: drop-shadow(0.3rem 0.3rem 0.1rem rgba(0, 0, 0, 0.5))
}

 

Link to comment
1 hour ago, hilary said:

I'd like a drop shadow filter added when the various images are hovered over

Your CSS worked for me for a single image block. I changed the block ID to my own block. I made some adjustments.

#block-yui_3_17_2_1_1648414546237_9701 .image-block-wrapper:hover {

  filter : drop-shadow( 0.3rem 0.3rem 0.1rem rgba( 0, 0, 0, 0.5 ) );
  
  }

For multiple blocks use a format like the following.

#block-yui_3_17_2_1_1648414546237_9701 .image-block-wrapper:hover,
#block-03cb185697cf6cef5ae8 .image-block-wrapper:hover

  {
  
    filter : drop-shadow( 0.3rem 0.3rem 0.1rem rgba( 0, 0, 0, 0.5 ) );
    
    }

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 4 weeks later...

@creedon Hmm, ok I tried it both ways - with one image block and then multiple and neither worked for me.

This did though: 🤷‍♀️

#block-yui_3_17_2_1_1681922577794_33752:hover,
#block-63648473c063af264f4f85f1:hover {filter: drop-shadow(0.15rem 0.15rem 0.04rem rgba(0, 0, 0, 0.5))
}

 

Edited by hilary
I found something that did work!
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.