• Resolved yonischirris

    (@yonischirris)


    Hi!

    – I have a theme that has a category menu underneath a big featured image, this category menu sticks to the top once you scroll past it
    – I want the reading bar to stick underneath that sticky category menu
    – Currently, the progress bar is already shown halfway the featured image (floating around nothing)
    – Expected result: The progress bar either…
    – Only is displayed when you’re far enough into the article so that the category menu bar sticks to the top
    – is stuck to the same position as the category menu bar (at first that is between the featured image and the post, later that is stuck to the top of the page)

    – My current solution is to change line 200 in wtr.js to

    else if(beyond > 0 && winScroll > 0 && $('#sticky-wrapper').hasClass("ruby-is-stick")) {

    to only display the reading bar when the menu is sticking to the top.

    Q: What is the cleanest way to add this Javascript? If I edit the wtr.js file directly in the plugin files, any new update will overwrite this change, which I want to avoid.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Cleanest way to edit JavaScript functionality’ is closed to new replies.