Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. How to anchor-to-another-page in phone version

How to anchor-to-another-page in phone version

Scheduled Pinned Locked Moved General Discussion
7 Posts 2 Posters 130 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ivonnefehn
    wrote on last edited by
    #1

    Dear Lay-Theme-Team,

    we have perfectly working anchors on our desktop version following your advice from the forum:
    <script>
    window.laytheme.on('newpageshown', function(){
    if(window.location.hash.length > 0){
    var id = window.location.hash;
    if(jQuery(id).length > 0){
    jQuery('html, body').animate(
    { scrollTop: jQuery(id).offset().top - 170 },
    { duration: 1200 });
    }
    }
    });
    </script>

    What do we have to do to make them work in the phone version, too?

    There the text-link directs to the right page but opens always on the top.
    It worked when we turned the phone version off.
    So we guess there's a way to get there but we just have no clue.
    We are not into JS at all (but we love your theme and created a wonderful
    page that's almost ready to launch) so I hope you have any advice for us
    on that topic.

    Thank you very much for your support!
    Best, Ivonne

    1 Reply Last reply
    0
    • mariusjopenM Offline
      mariusjopenM Offline
      mariusjopen
      Global Moderator
      wrote on last edited by
      #2

      Dear @ivonnefehn
      thank you!
      Did you give the IDs also to the elements in the custom phone layout?
      Best!
      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • I Offline
        I Offline
        ivonnefehn
        wrote on last edited by
        #3

        Dear Marius,

        yes, I just double-checked, I did give them the ID.
        And the links in the text of the mobile version are there, too.

        So from your question I guess it should work without doing anything else?
        Best, Ivonne

        1 Reply Last reply
        0
        • I Offline
          I Offline
          ivonnefehn
          wrote on last edited by
          #4

          Dear Marius,

          I rebuilt it on an old test-page and this is my experience:
          1
          It worked in the custom phone layout, too.
          That was with an older version of LAY.
          After I updated the theme it doesn't work anymore, it starts at the top of the page.

          2
          It still works when I turn the custom phone layout off (breakpoint 0).

          3
          And I wonder:
          In case it worked on mobile, too:
          How does the phone layout know what „top“ is?
          Because for the desktop version I entered in the „head CSS“ to start at top - 190 (the size of my menu bar):
          { scrollTop: jQuery(id).offset().top-190 },
          In the mobile menu my menu bar is 40 – so top here would be different.
          Or is that something the mobile version does automatically?

          I hope this is understandable ...
          Thanks a lot for your help.
          Best, Ivonne

          1 Reply Last reply
          0
          • mariusjopenM Offline
            mariusjopenM Offline
            mariusjopen
            Global Moderator
            wrote on last edited by
            #5

            Dear @ivonnefehn
            Can you post a link to your website?
            We will then have a look and inspect that!
            Many wishes!
            Marius

            www.mariusjopen.world

            1 Reply Last reply
            0
            • I Offline
              I Offline
              ivonnefehn
              wrote on last edited by
              #6
              This post is deleted!
              1 Reply Last reply
              0
              • mariusjopenM Offline
                mariusjopenM Offline
                mariusjopen
                Global Moderator
                wrote on last edited by
                #7

                DEAR @ivonnefehn
                NEVER NEVER NEVER POST A LOGIN TO WORDPRESS HERE.
                SEND A PM!

                I deleted your post.

                You need to uncheck "open link on new page" - then it works.
                Best!
                Marius

                www.mariusjopen.world

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                I also code custom websites or custom Lay features.
                💿 Email me here: 💿
                info@laytheme.com

                Before you post:
                1. When using a WordPress Cache plugin, disable it or clear your cache.
                2. Update Lay Theme and all Lay Theme Addons
                3. Disable all Plugins
                4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

                This often solves issues you might run into

                When you post:
                1. Post a link to where the problem is
                2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                Online Users
                G
                Glyph
                dafvD
                dafv
                Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                laytheme.com
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Recent
                • Tags
                • Popular
                • Users
                • Search