| Issue 110: | Iframe Resizing enhancement | |
| 2 people starred this issue and may be notified of changes. | Back to list |
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
Labels:
Type-Enhancement
Nov 6, 2008
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
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
This code is now included in the release 1.4.0 |