Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • 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 407 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
    I
    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
      mariusjopenM
      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
        I
        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
          I
          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
            mariusjopenM
            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
              I
              ivonnefehn
              wrote on last edited by
              #6
              This post is deleted!
              1 Reply Last reply
              0
              • mariusjopenM
                mariusjopenM
                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

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                Online Users
                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