Title: .offset().top function conflict
Last modified: February 21, 2018

---

# .offset().top function conflict

 *  [juliarrr](https://wordpress.org/support/users/juliarrr/)
 * (@juliarrr)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/offset-top-function-conflict/)
 * Hello, we have a problem on our site with your plugin YITH WooCommerce Compare.
   We use strict script versions and when using the .offset().top function there
   is no opportunity to remove products from the compare window as it is not loading.
   Here is the screenshot: [https://www.screencast.com/t/9BVILyDbu2Fs](https://www.screencast.com/t/9BVILyDbu2Fs)
 * JavaScript snippet:
 * jQuery(window).scroll(function () {
    if (jQuery(this).scrollTop() + jQuery(this).
   height() > jQuery(‘.footer_copyright’).offset().top) { jQuery(‘.woocommerce-store-
   notice’).css({‘position’ : ‘relative’}); } else { jQuery(‘.woocommerce-store-
   notice’).css({‘position’ : ‘fixed’}); } } );
 * Could you please let me know how can I resolve this problem? Thank you in advance.

Viewing 1 replies (of 1 total)

 *  Plugin Author [YITHEMES](https://wordpress.org/support/users/yithemes/)
 * (@yithemes)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/offset-top-function-conflict/#post-10112445)
 * Hi,
    try to change the JS snippet in this way, it should work fine
 *     ```
       jQuery(window).scroll(function () {
       if( jQuery('.footer_copyright').length && ( jQuery(this).scrollTop() + jQuery(this).height() ) > jQuery('.footer_copyright').offset().top) {
       jQuery('.woocommerce-store-notice').css({'position' : 'relative'});
       } else {
       jQuery('.woocommerce-store-notice').css({'position' : 'fixed'});
       }
       } );
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘.offset().top function conflict’ is closed to new replies.

 * ![](https://ps.w.org/yith-woocommerce-compare/assets/icon.svg?rev=3042935)
 * [YITH WooCommerce Compare](https://wordpress.org/plugins/yith-woocommerce-compare/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yith-woocommerce-compare/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yith-woocommerce-compare/)
 * [Active Topics](https://wordpress.org/support/plugin/yith-woocommerce-compare/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yith-woocommerce-compare/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yith-woocommerce-compare/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [YITHEMES](https://wordpress.org/support/users/yithemes/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/offset-top-function-conflict/#post-10112445)
 * Status: not resolved