{"id":1060,"date":"2013-08-29T14:23:50","date_gmt":"2013-08-30T00:23:50","guid":{"rendered":"http:\/\/mymonkeydo.com\/?p=1060"},"modified":"2013-08-29T14:23:50","modified_gmt":"2013-08-30T00:23:50","slug":"fancybox-not-working-after-second-click","status":"publish","type":"post","link":"https:\/\/mymonkeydo.com\/fancybox-not-working-after-second-click\/","title":{"rendered":"Fancybox not working after second click"},"content":{"rendered":"
Setting up fancybox 1.3.4 with inline content doesn’t work when clicking on the link twice.<\/p>\n
The problem I think is with the upgraded version of jQuery. \u00a0If using jQuery 1.4 like the example, it should work fine. \u00a0But if you are using jQuery 1.10+ or even 1.9 you may run into this problem. \u00a0 Update<\/strong>: There are other errors that occur with Fancybox and jQuery 1.9+. Stack overflow has the patch… but you still need to do this fix for the second click. Update 2<\/strong>: \u00a0Below is a patch to fix the inline issue too. \u00a0I only tested for one instance, so use with caution. \u00a0I added a objParent… look for that and that’s all the changes made.<\/p>\nThe work-around would be to explicitly set the content like so<\/del>: \u00a0The proper workaround is to save the parent of the element you want to lightbox and then on fancybox-cleanup replace the fancybox-inline-tmp element with the element you lightboxed like so:<\/p>\n\n var popupParent = jQuery("#popup").parent();\n jQuery(document).on('fancybox-cleanup', function() {\n popupParent.find('.fancybox-inlinetmp').replaceWith(jQuery("#popup"));\n });\n<\/pre>\n
\nhttp:\/\/stackoverflow.com\/questions\/14344289\/fancybox-doesnt-work-with-jquery-v1-9-0-f-browser-is-undefined-cannot-read<\/a><\/p>\n