Iframe-Height-Jquery-Plugin icon indicating copy to clipboard operation
Iframe-Height-Jquery-Plugin copied to clipboard

Can't load more than one (1) iFrame. Container DIV is assigned duplicate ID

Open JamoCA opened this issue 12 years ago • 2 comments

In version 1.2.4, if multiple iframes are accessed, frame_1 aborts processing as soon as frame_2 starts processing. If I delay the start of frame_3 using setTimeout, it will also load and not impact the other frame, but it's not a viable or promising workaround.

$('#frame_1').iframeHeight();
$('#frame_2').iframeHeight();
setTimeout(function(){
    $('#frame_3').iframeHeight();
},1000); 

Regarding the container DIV's non-unique IDs (when called multiple times), I changed it to this:

var divID = base.$el.attr('id') + '-iframeHeight-Container';
base.$el.before("<div id='"+ divID +"' style='padding:0; margin:0; border:none; background-color:transparent;'></div>");
base.$el.appendTo("#" + divID);
base.$container = $("#" + divID);

JamoCA avatar Oct 09 '13 18:10 JamoCA

Hi @JamoCA,

The big problem is "$.iframeHeight.resizeIframe" function because it is used from everywhere of plugin. If i change this, plugin cannot work from external (or crossdomain pages). So i must update the structure of plugin. It means it can be really big changes. Im sorry but I tried some things after emails but nothing changed. So i added this todo list.

Sly777 avatar Oct 09 '13 21:10 Sly777

I don't know if is the same problem, but to load multiple iframes add after "base.init();", this: uuid++;

zhiru avatar Feb 26 '14 15:02 zhiru