我有两个input领域。第二个input开始专注。然后我想要fadeOut两个inputs,让第二个input保持专注直到结束。最后,我想fadeIn同时input以第一个 input焦点结束。
但是,我不想看到“故障”,当第二个input在fadeIn完成后立即聚焦,然后第一个input立即聚焦。
这是我尝试过的(见小提琴here):
// Focus the second input field
$('input').eq(1).focus();
// Fade out both input fields
$('div').fadeOut();
// Fade in both input fields
$('div').fadeIn(function () {
// Causes a "transition glitch"
$('input').eq(0).focus();
});
有没有办法“预聚焦”第二个input领域?