Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

fancybox 2 afterClose + afterLoad works weird #106

dubcanada opened this Issue Jan 19, 2012 · 4 comments


None yet
2 participants


I have a fancyBox that gets opened in an iFrame and I have two callbacks, one for afterload and one for afterclose. If I take out the afterclose the callbacks work as expected, if I put in the afterclose callback it gets called when the afterload does.

                'href'               : 'site',
                'type'               : 'iframe',
                'width'              : '800',
                'height'             : '460',
                'maxWidth'           : '800',
                'maxHeight'          : '460',
                'autoSize'           : false,
                'fitToView'          : false,
                'scrolling'          : false,
                'keys'               : '',
                'modal'              : true,
                'closeBtn'           : true,
                'afterLoad'          : function () { $("body").css("overflow","hidden"); },
                'afterClose'         : function () { $("body").css("overflow","visible"); }

When I load it, the body overflow is always set to visible (even though it shouldn't be it should be hidden). If I take out afterclose callback it works as expect (but doesn't remove overflow on close.



fancyapps commented Jan 19, 2012

I just made a test having exactly the same code as in your example (except "href", of course) and it works as expected - afterLoad event sets overflow to hidden and afterClose - to visible. Maybe tell more details, how are you calling it?

I am using the version that had changes in it so the close button appeared when I set modal to true. Maybe that is the issue? That's pretty much exactly what I am doing.

That being said, is the version with the changes so modal does not take over everything imported into the main repo? Maybe I'll try that version.


fancyapps commented Jan 19, 2012

Try the latest from the source - https://github.com/fancyapps/fancyBox/zipball/master

@fancyapps fancyapps closed this May 8, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment