Jump to content

Lauray

Member
  • Posts

    2
  • Joined

  • Last visited

Reputation Activity

  1. Thanks
    Lauray reacted to paul2009 in Can I set my homepage to a different page for mobile only   
    Hi
    Yes, there's a workaround you can add for this. The code below assumes that the mobile version of your home page has the URL 'mobile'. Add the following code to the Code Injection area of the desktop Home page (you'll find this on the page settings on the Advanced tab):
    <script> if (screen.width<760) {window.location="/mobile";} </script>
    Paul

    UPDATEI've updated this answer to allow for devices with higher resolutions and to allow testing on browsers when the width has been reduced.

    Use the code below instead, adjusting the URL and the width (in pixels) to match your needs:

    <script> if (document.documentElement.clientWidth <760) { window.location = "/mobile"; } </script>
×
×
  • 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.