Jump to content

Scroll back to top of page on icon/image click

Recommended Posts

Site URL: http://www.dolphinbottles.co.uk

Hi,image.thumb.png.081397d8ddfca065a3d690088089ad6a.png

I was hoping to know if theres any code that when you click the mini logo in the right hand corner of the page it would auto-scroll back to the top of the page?

The logo is fixed. Code is:

<div id="dolphin-logo">
<img src="https://static1.squarespace.com/static/5efca1d4b38d327351cb3a48/t/5f80623086feca1a363d3f95/1602249265109/Untitled+design+%288%29+%281%29.png" width="110" height="55">
</div>

#dolphin-logo {
position: fixed;
top: 90%;
right: 0;
left: 80%;
transform: rotate(0deg) translateX(50%);
transform-origin: 100% 0;
z-index: 99999;
}
@media screen and (max-width: 960px) {
#dolphin-logo {
bottom: 2%;
left: 40%;
top: auto;
}
}

Appreciate any help 🙂

Link to comment
  • Replies 2
  • Views 685
  • Created
  • Last Reply

edit this

<div id="dolphin-logo">
<img src="https://static1.squarespace.com/static/5efca1d4b38d327351cb3a48/t/5f80623086feca1a363d3f95/1602249265109/Untitled+design+%288%29+%281%29.png" width="110" height="55">
</div>

to this

<a id="dolphin-logo" href="#">
<img src="https://static1.squarespace.com/static/5efca1d4b38d327351cb3a48/t/5f80623086feca1a363d3f95/1602249265109/Untitled+design+%288%29+%281%29.png" width="110" height="55">
</a>

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.