0

アニメーションなしでフォーカスを試してみましたが、完璧に機能しています。このような:

document.forms['search_form'].elements['search'].focus()

私がしたいこと?:

I am using Animation (Which is working Perfect). So how can i set Focus into 
the **textfield** with Animation.

そうする目的:

So that i dont have to click into the textfield for typing anything in it.

ここに私のコードデモがあります:

http://jsfiddle.net/HBgwx/3/

4

1 に答える 1

1
$('a').click(function(){
    $('html, body').animate({
        scrollTop: $('#search').offset().top
    }, 500);
    $("#search").focus();
    return false;
});

JSFIDDLE デモ

于 2013-09-14T10:10:54.693 に答える