How to disable fancybox window background action

http://www.monmouthchineseschool.com/
if you click "Staff" in the "Information" section, a fancybox window will open. Here is the jQuery code for it.

<script>
  jQuery(document).ready(function() { 
    jQuery("a.fancybox").fancybox({
      'hideOnContentClick' : false
    });
    jQuery("a.fancy_iframe").fancybox({
      'width' : '95%',
      'height' : '95%',
      'autoScale' : false,
      'type' : 'iframe',
      'centerOnScroll' : true,
      'onStart' : function() {
        $("body").css({'overflow':'hidden'});
      },
      'onClosed' : function() {
        $("body").css({"overflow":"visible"});
      }
    });
  }); 
</script>

overflow:hidden Deletes the scroll bar in the main window, but then if you click Mandarin, it will move the background image anyway.

Also in a separate note, how would I “move” the scroll bar from a modal window to a parent window, similar to the new Facebook view mode.

+3
source share
1 answer

I see what you use $("..")inside jQuery('...'). Are you trying to change that?

 jQuery("body").css({'overflow':'hidden'});
0
source

Source: https://habr.com/ru/post/1791861/


All Articles