That code snippet didn't seem to do anything. The paramaters for the if statement work fine, but the $(document).off bit doesn't seem to be making any difference.
I ended up modifying the code slightly and adding it to the jquery.fancybox-1.3.4.pack.js file. Here is what I did:
Add this after ;(function(b){
var pixelRatio = window.devicePixelRatio || 1;
if(window.innerWidth < 500 || window.innerHeight < 500 || window.outerWidth < 500 || window.outerHeight < 500 ) {
}else{
Then add };
just before the })(jQuery);
at the end of the document.
Not a super clean fix, but it works.
Live example at http://www.mshslc.org/gallery/debris-avalanche/