开发者

Resize event does not fire in Firefox, but I need to handle focus when FancyBox is shown

开发者 https://www.devze.com 2022-12-30 11:04 出处:网络
I am working on a solution where I need to have the first input field selected when a fancybox is shown. I have tried reacting to the resize event, which works fine in IE but not in Firefox. Also trie

I am working on a solution where I need to have the first input field selected when a fancybox is shown. I have tried reacting to the resize event, which works fine in IE but not in Firefox. Also tried reacting to th开发者_如何学运维e click event on the link that opens the box - but aparently this is too early so some other element steals focus afterwards. Any ideas??


use the onComplete callback:

$("#whatever").fancybox({
    onComplete: function() {
        $('#someTextBox').focus();
    }
});
0

精彩评论

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