• Pages that use ScrolTo are constantly checking and updating the class of my scrollto divs.

    If you inspect this page, you can see as soon as the page loads, ScrollTo starts checking and updated the div:
    https://midwestelitebasketball.com/

    It doesn’t seem like it should constantly be updating even when I am not scrolling.

    Does anyone know how to fix this?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author malihu

    (@malihu)

    The target divs classes are checked/updated when they’re within the viewport (this is for the highlighting functionality). The plugin is (by default) configured to work with dynamic elements (i.e. elements that are not necessarily present when page loads). Because of this, you see the target divs checked (by the script) even if you’re not actively scrolling.

    Did you have any issues with this? Is there a specific problem you encountered that needs to be fixed?

    If you want, you can always go to plugin settings and set a specific “Highlight selector(s)” value (a selector that’s not related to your 2 button links). This will make the script stop checking your page target divs.

    In addition, the plugin script has a hidden variable to completely disable dynamic elements but in order to use it, you’d need to edit a plugin file manually. In any case, you don’t really need to do this as simply setting a “Highlight selector(s)” will do the same thing.

    I hope I understood what you described ??
    Let me know what you think

    Thread Starter gnelsoncreative

    (@gnelsoncreative)

    Thank you for the quick response, much appreciated!

    It seems that usually when I use this plugin on previous sites the target divs are checked/updated when they come into viewport, but only once. Not constantly. See these gifs to see the difference:

    What I normally see:
    https://giphy.com/gifs/wa9MyOZUMMra1UMPCr/fullscreen
    – load page…nothing is updating
    – scroll to target div, when it comes in viewport the div is checked/updated
    – stop for a while, the div is NOT checked/updated
    – continue scrolling, div is checked/updated again

    What I see on the linked site:
    https://giphy.com/gifs/kS8Oq68PqcW327JkaM/fullscreen
    – load page…target div instantly starts check/update
    – scroll to target div, when it comes in viewport the div is checked/updated
    – stop on target div, CONTINUALLY checks/updates

    If this is expected behavior I guess there is no specific issue to fix. It is just causing problems for me when I am trying to inspect and style elements in the browser, I cannot copy/paste new styles I write easily because the div is constantly updating and resets my highlight/cursor.

    This is a bit hard to explain, but hopefully you understand ??

    Plugin Author malihu

    (@malihu)

    Yes I understand. It’s almost impossible to add styles on-the-fly in dev tools when the element is checked in intervals.

    I’m not sure but this might happen due to page layout in relation to plugin settings and/or other scripts in the page.

    In your case, it’s best to set a selector value in “Highlight selector(s)” option. Since you use the plugin on the buttons (that don’t need highlighting), you could add any other selector value (e.g. a.whatever) and it should do the trick.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Browser constantly checking and updating div class’ is closed to new replies.