Ptphotography Posted December 21, 2020 Share Posted December 21, 2020 Hello, I hope everyone is doing well. Guys, please help me with the code to have second image appear smoothly when I hover my mouse on the main picture - and if I click on that picture, I would like for it to get redirected to another page if possible. If possible, I would like the page to refresh and not opened on another browser. Here is the link: https://ptphotography.squarespace.com/projects-with-logo Thank you in advance. Kind regards, K Edit: I have added the images in image block and added link in it.. Link to comment
tuanphan Posted December 21, 2020 Share Posted December 21, 2020 You want: Click Main image > the browser will open new site in same page Hover main image > 2rd image will show? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Ptphotography Posted December 22, 2020 Author Share Posted December 22, 2020 @tuanphan Thank you for your reply. When I hover over main image, I want a second image to show. And if I click on the image, it gets redirected to a link. Please help me with the code. Stay safe, K Link to comment
derricksrandomviews Posted December 22, 2020 Share Posted December 22, 2020 This should help: https://www.tiffany-davidson.com/blog/squarespace-change-image-on-hover with click thru url. Link to comment
Ptphotography Posted December 28, 2020 Author Share Posted December 28, 2020 @derricksrandomviews After two weeks of waiting, finally got a functional code! This is wonderful. I didn't know it was that simple! I am so grateful for your assistance and patience. Stay safe, K Link to comment
tuanphan Posted January 3, 2021 Share Posted January 3, 2021 For anyone, you can use Image Blocks (add link) then use this code to make image change on hover. Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Ptphotography Posted January 3, 2021 Author Share Posted January 3, 2021 thanks @tuanphan Suppose we write your code: /* hide image on hover */ div#block-yui_3_17_2_1_1577707091631_3805 a:hover img { opacity: 0; } div#block-yui_3_17_2_1_1577707091631_3805 a img { transition: all ease-in-out 0.9s; opacity: 1; } /* Set new image */ div#block-yui_3_17_2_1_1577707091631_3805 a { background-image: url(https://cylinder-mackerel-pnk5.squarespace.com/s/img1.jpg); background-size: cover; display: block; } Where/How do we rewrite your code in order to get redirected to another page if the image/images is clicked? This is where I am struggling. Basically what we need is a code for a second image to appear on hover and if the image is clicked, it gets redirected to another site/page. Thanks! Link to comment
tuanphan Posted January 3, 2021 Share Posted January 3, 2021 Image Block allow you to add link. You can check again. Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Ptphotography Posted January 3, 2021 Author Share Posted January 3, 2021 But of course, how can I forget that 😆 Bless you! Link to comment
tuanphan Posted January 6, 2021 Share Posted January 6, 2021 Have you solved it yet? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Ptphotography Posted January 6, 2021 Author Share Posted January 6, 2021 Sorry @tuanphan I have not figured it out yet. Please help! 22 minutes ago, tuanphan said: Have you solved it yet? This was my question I case it gets confusing: On 1/3/2021 at 3:07 PM, Ptphotography said: thanks @tuanphan Suppose we write your code: /* hide image on hover */ div#block-yui_3_17_2_1_1577707091631_3805 a:hover img { opacity: 0; } div#block-yui_3_17_2_1_1577707091631_3805 a img { transition: all ease-in-out 0.9s; opacity: 1; } /* Set new image */ div#block-yui_3_17_2_1_1577707091631_3805 a { background-image: url(https://cylinder-mackerel-pnk5.squarespace.com/s/img1.jpg); background-size: cover; display: block; } Where/How do we rewrite your code in order to get redirected to another page if the image/images is clicked? This is where I am struggling. Basically what we need is a code for a second image to appear on hover and if the image is clicked, it gets redirected to another site/page. Thanks! Kind regards, K Link to comment
tuanphan Posted January 7, 2021 Share Posted January 7, 2021 On 1/3/2021 at 6:28 PM, tuanphan said: Image Block allow you to add link. You can check again. Have you checked this yet? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Ptphotography Posted January 7, 2021 Author Share Posted January 7, 2021 41 minutes ago, tuanphan said: Have you checked this yet? Yes sir! Link to comment
tuanphan Posted January 8, 2021 Share Posted January 8, 2021 URL doesn't exist. https://ptphotography.squarespace.com/projects-with-logo Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.