Title: Cleanest way to edit JavaScript functionality
Last modified: February 8, 2019

---

# Cleanest way to edit JavaScript functionality

 *  Resolved [yonischirris](https://wordpress.org/support/users/yonischirris/)
 * (@yonischirris)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/cleanest-way-to-edit-javascript-functionality/)
 * 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)

 *  Thread Starter [yonischirris](https://wordpress.org/support/users/yonischirris/)
 * (@yonischirris)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/cleanest-way-to-edit-javascript-functionality/#post-11200984)
 * I missed the last option in the plugin settings: content offset. This solved 
   the issue.
 *  Plugin Author [brianmcculloh](https://wordpress.org/support/users/brianmcculloh/)
 * (@brianmcculloh)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/cleanest-way-to-edit-javascript-functionality/#post-11201528)
 * Great!

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

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

 * ![](https://ps.w.org/worth-the-read/assets/icon-128x128.png?rev=1482821)
 * [Worth The Read](https://wordpress.org/plugins/worth-the-read/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/worth-the-read/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/worth-the-read/)
 * [Active Topics](https://wordpress.org/support/plugin/worth-the-read/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/worth-the-read/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/worth-the-read/reviews/)

## Tags

 * [edit](https://wordpress.org/support/topic-tag/edit/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 2 replies
 * 2 participants
 * Last reply from: [brianmcculloh](https://wordpress.org/support/users/brianmcculloh/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/cleanest-way-to-edit-javascript-functionality/#post-11201528)
 * Status: resolved