Fancybox is "dancing" around

So, I had such a problem with FancyBox when, when scrolling the body of the page (main page), the field shifts left and up in a random order.

Attached GIF to demonstrate the problem:

img

I use Fancybox v2 as far as I know.

The website is here (under the "daily training" tab).

This is the code I use to call fancybox:

$(".signup").fancybox({ maxWidth: 800, maxHeight: 600, fitToView: false, width: '70%', height: '70%', autoSize: false, closeClick: false, openEffect: 'none', closeEffect: 'none' }); 

I checked their API, but could not understand what makes the position "dance".

================

EDIT

So I managed to isolate the problem. when I add "openEffect:" none "everything goes against it. Without it, the box remains static and sticks to the upper left side of the screen.

any further ideas?

+5
source share
3 answers

if you don’t need a scrollable website, set the closeClick value to true or delete it, the window will be shown as modal and you will not be able to scroll the main page while the modal file is open.

 var busy = false; // the html class is "o" $(".o").fancybox({ //modal: true beforeClose: function() { if (busy) { return false; } } }); 

Example here: http://jsfiddle.net/MLjAT/

0
source

As far as I can see, the window is moving due to CSS transition and -webkit-transition , which are added by some JavaScript code. You have to check where he comes from. Try to break every step. There is also a chance that the problem is due to some kind of conflict in the code, so also check this.

0
source

Try adding this to your doctype.

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 

helped me in the past

0
source

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


All Articles