• When the quick view lightbox opens I can still scroll the website behind the quick view lightbox. This happens both on desktop and mobile. How can I stop the background/website from scrolling when the YITH Quick View lightbox opens?

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi there,

    Could you share the website URL with us, please ? We need to make some tests about that, seems something related to a wrong CSS rule.

    Have a nice day
    YITH

    Thread Starter lucyaneu

    (@lucyaneu)

    The website is behind a maintenance page since it’s a staging site. How can I get you the URL and login without posting them here?

    Thank you!

    Plugin Author YITHEMES

    (@yithemes)

    Hi @lucyaneu

    it’s a very bad practice to share access data here. It’s better if you remove the maintenance mode for a testing and then enable it again.

    Thanks for understanding.

    Thread Starter lucyaneu

    (@lucyaneu)

    Hi @yithemes

    Turned off the maintenance page for now. Here’s a link to one of the category pages: https://wcc.theblugroup.net/shop-category/hodge-podge/

    Plugin Author YITHEMES

    (@yithemes)

    Hi,

    you can achieve your goal by adding the following code snippet to your theme functions.php

    if ( ! function_exists( 'yith_wcqv_customization_disable_scrolling' ) ) {
    	add_filter( 'wp_enqueue_scripts', 'yith_wcqv_customization_disable_scrolling', 999 );
    
    	function yith_wcqv_customization_disable_scrolling() {
    		$js = "( function( $ ){
    				var qv_modal    = $(document).find( '#yith-quick-view-modal' ),
    					qv_overlay  = qv_modal.find( '.yith-quick-view-overlay'),
    					qv_close    = qv_modal.find( '#yith-quick-view-close' ),
    					disableScrolling = function (){
    						var x=window.scrollX;
    						var y=window.scrollY;
    						window.onscroll=function(){window.scrollTo(x, y);};
    					},
    					enableScrolling = function (){
    						window.onscroll=function(){};
    					}
    			
    				$(document).on('qv_loader_stop', disableScrolling);
    			
    				qv_overlay.on( 'click', function(e){
    					enableScrolling();
    				});
    			
    				$(document).keyup(function(e){
    					if( e.keyCode === 27 )
    						enableScrolling();
    				});
    				
    				qv_close.on( 'click', function(e) {		
    					enableScrolling();
    				});
            } )( jQuery );";
    
    		wp_add_inline_script( 'yith-wcqv-frontend', $js );
    	}
    }

    Please try this solution and let us know if everything works fine!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to block the website scroll or overflow when Quick View is activated?’ is closed to new replies.