Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #441175 Score: 0
    Profile photo of George Bosveld
    George Bosveld
    Member
    beginner
    intermediate
    friend finder
    advanced
    curious george
    contributor
    wise owl
    picture perfect
    profile
    @GeorgeB

    Hi, I saw this: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_scroll_indicator

    And I tried to make it work in Lectora, but somehow the script won’t run when I have it either in meta tags <script> tages, in the header scripting nor in the bottom of file scripting.

    Anyone has a sollution for this?

    (I used custom div for the scrollbar with the html code for the progress container and bar, but if there’s a sollution with the Lectora progress bar that’s also fine for me.

    #441177 Score: 1
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    333 pts
    @timk

    Adding the event listener to the window should happen in a Run javascript action or another type of trigger. Otherwise the code won’t be executed.

    This post has received 1 vote up.
    Attachments:
    1. Scrollprogress.zip
    #441256 Score: 0
    Profile photo of George Bosveld
    George Bosveld
    Member
    beginner
    intermediate
    friend finder
    advanced
    curious george
    contributor
    wise owl
    picture perfect
    profile
    @GeorgeB

    Fantastic, thanks!

    #441600 Score: 0
    Profile photo of George Bosveld
    George Bosveld
    Member
    beginner
    intermediate
    friend finder
    advanced
    curious george
    contributor
    wise owl
    picture perfect
    profile
    @GeorgeB

    Seems it only works if I don’t load jQuery via a html extension.

    I have a little code that scrolls to the top (we use long pages):

    function STT() {
    $(‘html, body’).animate({scrollTop: $(‘#pageDIV’).offset().top -50 }, ‘slow’);
    }

    Now that obviously doesn’t work anymore. You have any idea how comes that loading jQuery doesn’t let the scrollbar code work?

    This code works for most modern browsers and is a fix for now:

    window.scroll({ top: 0, left: 0, behavior: ‘smooth’ });

    Wonder still though if you know a solution wiht jQuery loaded and the old code 🙂

     

    Kind regards,

    George

    #441605 Score: 0
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    333 pts
    @timk

    Where did you put jQuery? I tried but I can’t recreate the issue.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.