javascript - Fancybox can't reopen popup: Uncaught TypeError: Cannot read property 'width' of null -


using latest fancybox , jquery 2.2.3 i'm trying open "child" popup pressing button in "parent" popup, , reopen parent popup after closing child popup.

by themselves, popups open , close fine. when try go reopen parent, shows second, disappears message in console: "jquery.fancybox.pack.js:40 uncaught typeerror: cannot read property 'width' of null". happens point this: this.overlay.width(a).height("100%");

when try reopen parent manually, intstead see popup "the requested content cannot loaded. please try again later."

i've tried 2 approaches, both fail

(.fancybox-to-form button inside parent, pressing open child):

1)

$(".fancybox-to-form").on("click", function(){     var parentpopup = $(this).closest(".wall-popup");      $.fancybox.open( $("#popup-form"), {                 afterclose: function(){             $.fancybox.open( {href: '#wall-popup--1'} );         }     } ); }); 

2)

$(".fancybox-to-form").fancybox({     afterclose: function(){         var parentpopup = $(this.element).closest(".wall-popup");         $.fancybox.open( parentpopup );     } }); 

help appreciated.

you can try settimeout 2nd fancybox. (~100ms) maybe 1st fancybox not closed @ time 2nd displayed.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -