Perhaps you need to call focus() in the callback of fadeIn(150) ?

Thanks & Regards,
Dhruva Sagar.




On Sat, Dec 5, 2009 at 5:53 AM, Igor Benko <igor.be...@gmail.com> wrote:

> Hi all,
>
> I have this weird problem I just can't find a way to solve. I'm using
> simpleModal plugin as login window and I want to set focus to username
> input upon window showing, but can't manage to do that.
> This is my code:
>    $("#prijava_popup").modal(
>    {opacity: 30,
>        onOpen: function (dialog) {
>            dialog.overlay.fadeIn(150, function () {
>                dialog.container.slideDown(150, function () {
>                        dialog.data.fadeIn(150);
>                });
>            });
>
>            $('div#simplemodal-container input[name=uime]').focus();
>
>        },
>        onShow: function (dialog) {
>            $('div#simplemodal-container input[name=uime]').focus();
>           });
>
>        }
>    });
>
> But it doesn't work, I can hide input field but can't set focus to it.
> Is this solvable?
>
> Thank you in advance for your answer, best regards, Igor Benko
>

Reply via email to