Fix “Object #<Object> has no method ‘onCleanup’ fancybox”

If you’ve used Fancybox before, you’ll know that it’s a double edged sword. The plugin works wonders when moulded the right way, but miss one thing and everything starts going wrong. The issue here is that jQuery plugins, in general, do not give enough feedback.

So for a few weeks now, I’ve been getting the following error: Object #<Object> has no method ‘onCleanup’ fancybox. And since it was on a low priority task, I’ve been delaying its correction. I have also been delaying because the error says absolutely nothing to me. Why would Fancybox miss a function when all the code has been minified in one single file, right?

Well, that’s where I was wrong. The issue is not about Fancybox missing anything. The issue is actually in the CSS. A proper Google search sent me towards a guy who got the exact same bug because he did not include Fancybox’s CSS.

So I went back to my code and, indeed, my CSS file was corrupt! So yeah, if you get this error “Object #<Object> has no method ‘onCleanup’ fancybox”, be sure to check if your “jquery.fancybox-1.3.4.css” file is included correctly.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

captcha

Please enter the CAPTCHA text