質問

my login page has an input with "autofocus" property:

<input class="username" type="text" placeholder="Username" autofocus required="required" value="">

This works... But I would like to hide the body until it has completely been loaded:

<body style="visibility: hidden;" onload="$('body').css('visibility', 'visible');">

This also works, but now, the autofocus property seems to be ignored... Is there a way to make both autofocus and body/hidden working?

Thanks, Fred

PS: sorry for my poor english!

役に立ちましたか?

解決

 <input class="username" type="text" placeholder="Username" required="required" value="">

        $(document).ready(function () {
            setTimeout("$('.username').focus();", 500);

        });

http://jsfiddle.net/kJUD7/9/

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top