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. Anchor does does not scroll to correct position

Anchor does does not scroll to correct position

Scheduled Pinned Locked Moved General Discussion
6 Posts 2 Posters 78 Views 2 Watching
  • 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.
  • U Offline
    U Offline
    user-4'33''
    wrote last edited by
    #1

    On this page, the anchor for the (contact) menu does not scroll to the correct position. It only scrolls a little bit, so I would need to click multiple times to achieve accurate scrolling.

    The (contact) menu is the first row of a footer, present on each page. This first row has a text element linking to #contact as well as it is sticky and straight visible at initial visit. Because of this, the element with the #contact ID itself is in the row below which was the cause of an earlier issue of the same kind.

    It was working correctly previously when I did not write this contact section as a footer. So I think it has sth to do with the footer architecture since, for example, the (works) menu has expected behaviour....

    1 Reply Last reply
    0
    • arminunruhA Offline
      arminunruhA Offline
      arminunruh
      Global Moderator
      wrote last edited by
      #2

      Hi luis!

      Yeah, I think this is just some more complications with custom code.
      Now that part of your website relies on a lot of custom coding, other parts of Lay Theme may not be compatible with it so well.

      Can you please send:

      • a link to this forum topic
      • your website address
      • /wp-admin/ username and password
        to: info@laytheme.com

      I wanted to add some code to your custom code that we already have to probably fix this, but it seems like you changed your login info to your admin panel.

      1 Reply Last reply
      1
      • arminunruhA Offline
        arminunruhA Offline
        arminunruh
        Global Moderator
        wrote last edited by
        #3

        Okay, so basically for your contact anchor, I removed the anchor: #contact

        And instead I just wrote some JavaScript that will scroll your page to the bottom when this button is clicked.

        image.png

        jQuery(document).on('click', '#contact-button', function(e){
            e.preventDefault();
            e.stopPropagation();
            jQuery("html, body"). animate({ scrollTop: jQuery(document). height() }, "slow");
        })
        
        U 1 Reply Last reply
        0
        • arminunruhA arminunruh

          Okay, so basically for your contact anchor, I removed the anchor: #contact

          And instead I just wrote some JavaScript that will scroll your page to the bottom when this button is clicked.

          image.png

          jQuery(document).on('click', '#contact-button', function(e){
              e.preventDefault();
              e.stopPropagation();
              jQuery("html, body"). animate({ scrollTop: jQuery(document). height() }, "slow");
          })
          
          U Offline
          U Offline
          user-4'33''
          wrote last edited by user-4'33''
          #4

          @arminunruh
          Many thanks for that, Armin! =))

          It works nicely on Desktop, but on mobile it did not work on either Firefox, Chrome or Safari...

          What could be the issue?

          U 1 Reply Last reply
          0
          • U user-4'33''

            @arminunruh
            Many thanks for that, Armin! =))

            It works nicely on Desktop, but on mobile it did not work on either Firefox, Chrome or Safari...

            What could be the issue?

            U Offline
            U Offline
            user-4'33''
            wrote last edited by
            #5

            @user-4-33 Ah I see, it โ€“ย it's the anchor that's still there...

            1 Reply Last reply
            1
            • arminunruhA Offline
              arminunruhA Offline
              arminunruh
              Global Moderator
              wrote last edited by
              #6

              ah yea maybe u can change that

              bascially you just remove #contact from the href=""

              so the href is just empty, then give the contact button id="contact-button"

              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

              Our Web Development company: 100k.studio

              Want to tip me? https://www.paypal.com/paypalme/arminunruh

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