Support » Plugin: YITH WooCommerce Compare » .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

    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

    (@yithemes)

    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.