• hi,

    Trying for hours to get it to work, but it does not ??

    I have made lists, even though I click the link I have made it does not scroll. It does not factor in the offset either.

    If I scroll to the top of the page and click the link again, it scrolls, and the offset works. But it does not seem to be working on the first click. Only the second time I click it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter larskorvald

    (@larskorvlad)

    Sometimes it works ok, then suddenly it jumps to a whole other place than I want it to.

    Also if I click on the link right after page load it does not seam to be fully loaded.

    Plugin Author malihu

    (@malihu)

    Hi,

    Can you post your site’s URL so I can check what’s happening? I can’t really help with such issues unless I see your page.

    Thread Starter larskorvald

    (@larskorvlad)

    hi.

    Here is a test page: https://www.trailsofnorway.com/test

    pasword is: test

    Plugin Author malihu

    (@malihu)

    I just checked the test page with multiple browsers and smooth scrolling, offset etc. works for me every time.

    The issue you’re having is most likely because you’re using a plugin or theme that is loading images on-the-fly while the page is scrolling (lazy loading images).

    When each image is loaded, it changes the documents length while page is scrolling. This means that the position of targets is also changing while page scrolling takes place (e.g. if the targets are placed after an image, this newly loaded image will “push” them further down).

    The problem is that your image placeholders do not have the same height (and probably width) with the actual image that’s going to be loaded.

    For example in your test page, the image placeholder at the bottom has an initial height of 677 pixels but the image loaded has a height of 540 pixels. This means that any target below this image will have an “incorrect” scrolling position of 127 pixels. This “incorrect” position will become “correct” after the image has loaded, that’s why the 2nd time you click the link it works correctly.

    Lazy loading images affects all kinds of same-page links (i.e. anchor points). Even if you didn’t use “Page scroll to id”, you’d have the same issue. The page would “jump” to an id but if you had an image right before it, it would push this id further down after the image was loaded and rendered.

    The only way to “fix” this is to have image placeholders that have the correct dimensions (esp. height) set (the same height as the actual image to be loaded). This of course might be complicated to do because the actual image elements are affected by certain CSS rules (like max-width: 100%;) that modify their height when rendered.

    Hope all the above makes sense and explains what happens.

    Thread Starter larskorvald

    (@larskorvlad)

    Ah.

    That makes sense. I will try to disable lazy loading on that page and see if that works.

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Does not’ is closed to new replies.