Jump to content

Add 'Back to top' button for mobile site only.

Recommended Posts

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

Hi,

I've been using the forum for a while and it's been incredibly helpful whilst building my site.

I was wondering if it was possible to add a 'Back to top' button that targets my mobile site only. I created one using a code block in the footer and adding the code <a href="#" class="scrollup">Back to top</a> which works perfectly, however it's not necessary to have it on my desktop site and I don't particularly like how it looks (I have removed it for the time being).  

Is there a way of using a similar code the only shows on the mobile site, or is this something that can't be done.

Any help help would be much appreciated. 

Thanks in advance,

Tim.

Site URL: www.timjobling.co.uk

Link to comment
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Solved:

I added the original code in the footer:

<a href="#" class="scrollup">Back to top</a> 

Then hid it from the desktop view using the code:

@media only screen and (min-width: 640px) {
#block-yui_3_17_2_1_1611505021315_44741 {
   display: none;
 }
}

Edited by timjphoto
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.