A
A
Alexander Kudryashov2017-02-15 15:02:42
JavaScript
Alexander Kudryashov, 2017-02-15 15:02:42

How to close fancybox by clicking outside the window?

Hello. The code:

jQuery("#price-form").fancybox({
  'transitionIn'	:	'fade',
  'transitionOut'	:	'elastic',
  'speedIn'		:	5000, 
  'speedOut'	:	200, 
  'overlayShow'	:	false,
  'padding'		:       0,
  'margin'		:       0,
  'height'		: 	'auto',
  'maxHeight'	:       '100%',
  'modal'		: 	'true',
  'scrolling'		: 	'auto',
  'width'		: 	'100%',
  'maxWidth'	:  	1920,
  'fitToView' 	: 	false,
  'autoSize'  	: 	false,
  'autoCenter'	: 	true,
  helpers: {
    overlay: {
      locked: false
    },
    keys: {
      close: [27]
    }
  }
});

1. How can I close the window when I click on an area of ​​a modal window?
2. How to close the window by pressing the esc button? I tried keys, it didn't work.
How many dug in the docks and Google did not find. Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Pyrkin, 2017-02-15
@ps1panda

1) 'hideOnOverlayClick':true
2) 'enableEscapeButton':true

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question