fancyapps/fancyBox — Issue #57: iFrame Resize
Author: zsoltib
Created: 2011-12-13 01:58:07+00:00
State: open

this was found on your Google Code Project profile, i'm hoping to have this same functionality in v.2

Reported by ste...@schult.mobi, Jun 10, 2011
What steps will reproduce the problem?
1. $.fancybox.resize not working with resized iframe

Code for selfresizing-iframe:
parent.$.fancybox.resize({width: width, height: height});

Attached a patch for the problem
Patch below

Index: 00_master/js/jquery.fancybox.js
===================================================================
--- 00_master/js/jquery.fancybox.js	(revision 234)
+++ 00_master/js/jquery.fancybox.js	(revision )
@@ -1002,8 +1002,21 @@
}
};

-	$.fancybox.resize = function() {
+	$.fancybox.resize = function(dimensions) {
if (overlay.is(':visible')) {
+	if(dimensions){
+	if(dimensions.width){
+	currentOpts.width = dimensions.width;
+	}
+	if(dimensions.height){
+	currentOpts.height = dimensions.height;
+	}
+	content.css({
+	'width' : currentOpts.width,
+	'height' : currentOpts.height
+	});
+	wrap.width(currentOpts.width + currentOpts.padding*2);
+	}
overlay.css('height', $(document).height());
}

@@ -1153,4 +1166,4 @@
$.fancybox.init();
});

-})(jQuery);
\ No newline at end of file
+})(jQuery);