I have a couple of youtube iframes loaded into a channel entry. I also have a script running that resizes those iframes. It appears the script fires on window load but it appears that it fires before the iframes load in from craft. Is there any quick fix to this issue and if so how do I fix it?
1 Answer
This seems more like a jquery issue then a craft issue. You might look into jquery's load
method. Doing a quick google search I came up with this possible solution, which you would need to adapt.
function callIframe(url, callback) {
$(document.body).append('<iframe id="myId" ...>');
$('iframe#myId').attr('src', url);
$('iframe#myId').load(function() {
callback(this);
});
}