<input class="username" type="text" placeholder="Username" required="required" value="">
$(document).ready(function () {
setTimeout("$('.username').focus();", 500);
});
autofocus not working if body is hidden?
Domanda
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!
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow