NyroModal 1.5.0
What steps will reproduce the problem?
1. Open a new modal with a link and a "_blank" parameter, in order to use
an iframe. I have a form in my iframe. I use it (reload the content of the
iframe).
2. When closing the modal, call to the callback "beforeHideContent" to get
elements in my iframe.
3. I use elts.contentWrapper to find an element, but the elements are
stopped at the iframe : see the following code :
var beforeHideContent = function(elts, settings, callback) {
console.info(elts.contentWrapper.find("#nyroModalIframe #myID"));
callback();
}
selector "#nyroModalIframe" return a jQuery object.
selector "#nyroModalIframe #myID" return an empty object ! What's wrong ?
I found a solution : using the "contents()" jQuery function : For my code : var beforeHideContent = function(elts, settings, callback) { console.info(elts.contentWrapper.find("#nyroModalIframe").contents().find("#myID")); callback(); } It works fine. elts.contentWrapper.find("#nyroModalIframe").contents() return a jQuery object with all the document in case of iframe.