hannamathilde1570047972 Posted March 31, 2015 Share Posted March 31, 2015 Hi Wondered how you can replace an image when hovering over. So another image will be displayed when hovering over. Cheers! Hanna Link to comment
Bernard West Posted March 31, 2015 Share Posted March 31, 2015 Please provide a link to your site so we have something to work with. There's various ways to do this, depending on what element you want to change and how it has been set up. Link to comment
hannamathilde1570047972 Posted April 1, 2015 Author Share Posted April 1, 2015 Thanks Bernard Here is the link http://www.beautyacademy.no So the three top images under the banner needs to be replaced by another image when hovered over. :) Link to comment
Bernard West Posted April 1, 2015 Share Posted April 1, 2015 To do this, you'll need to add some javascript to your site to target the image so it can be changed when hovered over. I'll see if I can help you with it tomorrow, unless someone else can think of a better way to do it. Just to check, what do you want to replace it with? Is it a variation of the same image, or a totally different image? Link to comment
clayyount Posted April 1, 2015 Share Posted April 1, 2015 You can do this with just Custom CSS: EDIT:I realized it's probably better to just target the actual image urls as opposed to their row: .image-block-wrapper:hover img.thumb-image[data-image="http://static1.squarespace.com/static/533fb429e4b0aa2aaadd87ca/t/551ace0be4b05d27e545eaf5/1427820045453/flagship.jpg"]{ content:""; display:block; background-size:cover; /* FIRST IMAGE*/ background: url(YOUR_IMAGE_URL) no-repeat top left; } .image-block-wrapper:hover img.thumb-image[data-image="http://static1.squarespace.com/static/533fb429e4b0aa2aaadd87ca/t/551ace62e4b01144c47b8ffd/1427820132658/78.jpg"]{ content:""; display:block; background-size:cover; /* SECOND IMAGE*/ background: url(YOUR_IMAGE_URL) no-repeat top left; } .image-block-wrapper:hover img.thumb-image[data-image="http://static1.squarespace.com/static/533fb429e4b0aa2aaadd87ca/t/551ace30e4b01144c47b8e4d/1427820082298/"]{ content:""; display:block; background-size:cover; /* THIRD IMAGE*/ background: url(YOUR_IMAGE_URL) no-repeat top left; } Link to comment
hannamathilde1570047972 Posted April 16, 2015 Author Share Posted April 16, 2015 Hey ghostcat, cheers for getting back to me. I'm wondering about the code you provided, each image is going to have another different image when i hover over. Same size and eveyrthing, just different text and image. What do I have to write with the code you provided? Hanna Link to comment
clayyount Posted April 16, 2015 Share Posted April 16, 2015 Edited my answer to allow for multiple background images Link to comment
dnissan Posted April 16, 2015 Share Posted April 16, 2015 Bernard, I'm looking for a similar answer, looking forward to your response. As far as I can tell, she's wanting a different picture to appear - but she'll clarify. https://answers.squarespace.com/questions/77492/text-to-appear-on-hover-of-image Hello! I'm a web designer at Piila Web Design. Check us out - http://www.piila.ca, our website will be live end of Summer 2016. This Squarespace Answers account was made a while ago using my personal email address. My business address is davidnissan@piila.ca. Send me an email to either one - let's chat. What makes us different is our ridiculously low prices compared to the big wigs, while at the same time providing high-quality content. We're super honest about what we can offer and what we're charging you for, so you know exactly what to expect and where your dollar is going towards. We also provide small, piecemeal solutions. For example, if you just want that one customization on your website, it could cost as little as just 10 bucks. Nice. Cheers! Link to comment
clayyount Posted April 16, 2015 Share Posted April 16, 2015 Sorry, I edited it again to target the specific image URLs so you can move the content around on the page without breaking the code. Link to comment
ChaseKantor Posted July 8, 2015 Share Posted July 8, 2015 Hey, I'm having a similar problem. Three images that I would like changed to other images on hover. Tried your code in custom css and didn't work for some reason. Does something have to go in the quotes of "content"? Link to comment
clayyount Posted July 8, 2015 Share Posted July 8, 2015 You don't need anything in the content string, but you need to change our the css selector to match your images's classes. .image-block-wrapper:hover img.thumb-image[data-image="IMAGE_URL'] was for hannamathilde's site, and probably doesn't apply to yours. Link to comment
LFortin Posted July 8, 2015 Share Posted July 8, 2015 You can do this by creating a div tag in a code block and changing the background with CSS #sample{ height:500px; background-image:url("yourimageurl"); background-size: cover; background-repeat: no-repeat; background-position:center; transition:.3s;} #sample:hover{ background-image:url("yourimageurl"); background-size: cover; background-repeat: no-repeat; background-position:center; transition:.3s;} Link to comment
ChaseKantor Posted July 8, 2015 Share Posted July 8, 2015 Thanks for getting back so quickly. Still having problems. Here's a link to the site. Any further help you can provide would be amazing.http://www.estate-litigators.com/media-centre/ Link to comment
ephraimdov Posted July 9, 2015 Share Posted July 9, 2015 .imgOverlay { width: 240px; height: 240px; background: url(img/fish-all.png) no-repeat; } .imgOverlay:hover { background: url(img/flower.png) no-repeat; } Full Source : CSS Image Overlay Lee Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.