jQuery prevents page scrolling behind the mobile side mask

  • 2021-08-03 09:17:54
  • OfStack

css code:

.ovfHiden{overflow: hidden;height: 100%;}

jquery:


 $(".header_right").click(function(){
    $('html,body').addClass('ovfHiden'); // Make Web Pages Non-scrollable 
    $(".searchbox").show();
  })
  $(".yg-close").click(function(){
    $('html,body').removeClass('ovfHiden'); // Make the web page scrollable again 
    $(".searchbox").hide();
  })

Related articles: