My favorites | Sign in
Project Home Downloads Issues
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 110: Iframe Resizing enhancement
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Jan 2009


 
Reported by anotherhero, Nov 6, 2008
Like with the youtube processHandler I've made an external file wich
enables resizing for modals with an Iframe

nyroModal.iframe.js :

jQuery(function($){
	$.fn.nyroModal.settings.endShowContent = function(elts, settings){
		var iframe = elts.content.find('iframe');
		if (iframe.length && iframe.attr('src').indexOf(window.location.hostname)
!== -1) {
			var body= iframe.contents().find('body');
			if (body.height() > 0) {
				$.nyroModalSettings({
					height: body.height(),
					width: body.width()
				});
			}
			
			iframe.bind('load', function(){
				var body= iframe.contents().find('body');
				if (body.length) {
					$.nyroModalSettings({
						height: body.height(),
						width: body.width()
					});
				}
			});
		}
	};
});
Nov 6, 2008
Project Member #1 nyro...@gmail.com
Thanks for your code!
Did you test it with IE and other browser (Safari, Opera)? with different domain in
the iframe?

Labels: Type-Enhancement
Nov 6, 2008
#2 anotherhero
Yes, I've tried it with IE 6, 7 Safari, Opera and Firefox.

It only works for Iframes that link to the same domain.
If someone knows a way to do it with external domains let me know, because as far as
I know its considered cross site scripting.
Jan 27, 2009
Project Member #3 nyro...@gmail.com
anotherhero, your code will be included in the next release.
If you have a blog or a website, I'll be glad to link it.
Status: Fixed
Feb 11, 2009
Project Member #4 nyro...@gmail.com
This code is now included in the release 1.4.0

Powered by Google Project Hosting