Reputation: 187
Using nyroModal I have setup a modal window with some text boxes. This window pops up on page load. I need focus to be set to the first text box. I have tried this, but it doesn't work:
$(document).ready(function () {
$.nmManual('pageToLoad.html'});
$.fn.nyroModal.settings.endShowContent = function(elt, settings) {
$('input:text:first', elt.content).focus();
};
...some more code here...
});
There isn't much documentation for the endShowContent, so hopefully someone here can lend me a hand.
Upvotes: 0
Views: 862
Reputation: 347
The right code should be:
$.nmManual('pageToLoad.html', {
callbacks: {
afterShowCont: function(nm) {
nm.elts.cont.find('input:text:first').focus();
}
}
});
Upvotes: 0
Reputation: 8059
As i found from docs of nyroModal it should called by:
$.nmManual('pageToLoad.html',{callbacks: {afterShowCont: function() {}}}
Upvotes: 1