使用nyroModal,我设置了一个带有一些文本框的模式窗口。此窗口在页面加载时弹出。我需要将焦点设置到第一个文本框。我试过了,但它不起作用:
$(document).ready(function () {
$.nmManual('pageToLoad.html'});
$.fn.nyroModal.settings.endShowContent = function(elt, settings) {
$('input:text:first', elt.content).focus();
};
...some more code here...
});没有太多关于endShowContent的文档,所以希望这里有人能帮我一把。
发布于 2011-07-20 13:31:43
正如我从nyroModal的文档中发现的,它应该通过以下方式调用:
$.nmManual('pageToLoad.html',{callbacks: {afterShowCont: function() {}}}发布于 2012-10-28 01:32:09
正确的代码应该是:
$.nmManual('pageToLoad.html', {
callbacks: {
afterShowCont: function(nm) {
nm.elts.cont.find('input:text:first').focus();
}
}
});https://stackoverflow.com/questions/6756958
复制相似问题