开发者

Jquery UI Accordion focus on focus first input in active content

how can focus on first input i开发者_开发百科n active content when it changed ?


$( ".selector" ).accordion({
    activate: function(event, ui) {
        $(ui.newPanel).find("input:first").focus();
    }
});

Originally answer was based on the jQuery Accordion Demo, but the API has changed in the meantime.


I'm working with JQuery UI control and I had a trouble with focusing the first input of my page. Here is the solution:

setTimeout(function () { $("#dvCreateItem").find("input:first").focus(); }, 1000);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜