开发者

On focusout, focus

Does jQuery prevent this type of behavior?

$("input").focusout(function() {
    $(this).focus();
});开发者_运维百科


This is how it's done (works cross-browser):

$('input').blur(function() {
    var that = this;
    setTimeout(function() { $(that).focus(); }, 0);
});

Live demo: http://jsfiddle.net/jzt2Z/1/


1) Actually it works in Chrome. Here is an example: http://jsfiddle.net/8WP53/

Once 1st input gets focuseout - it remains focused, and user cannot focus any other input

2) in IE I get an error "Stack overflow" (brand name StackOverflow.com error :) )

3) Strange, but in Firefox you can select any input, but no error is being produced

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜