-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: onLoaded option #36
Comments
Sorry, I'm a little overloaded at the moment w/ life things. I can probably add this and #35 this week. As far as larger feature requests like #33, #37, #38, I'm planning to make a more feature rich spin off of this library from the ground up at some point, and new development time will likely go there instead of here. It should be fully backwards compatible. But I'd like to keep this one as slim as possible so people will continue to have that option (not that the new one is going to be massive -- but still). |
Fine Thanks, #25 would be awesome too. |
Unfortunately it seems that iframes always trigger the load event even if there's an error. So we can't rely on We would have to access the document, but that's blocked for all cross-origin frames. And because that's what users of this library will be loading 99% of the time, I feel like including error / load callbacks for iframes is going to confuse people. However, if you're using a same-origin frame, you should still be able to get what you need using animationStart: function () {
var iframe = document.querySelector('#bp_container iframe')
iframe.addEventListener('load', function () {
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
var iframeBody = iframeDoc.body;
console.log('iframeBody', iframeBody);
}, {once: true})
} ({once: true} is not supported in IE, so use a different method -- like storing whether the listener has been added previously, or manually removing the listener using onClose -- if you need to support it) |
Please add an onLoaded option.
I need this to detect if the iframe initialized a download popup, in which case, the onLoaded option allow me to detect if data appear in iframe; and thus, I can close BigPicture
The text was updated successfully, but these errors were encountered: