Skip to content

Instantly share code, notes, and snippets.

View iguu's full-sized avatar

Satoshi IGUCHI iguu

View GitHub Profile
@iguu
iguu / gist:5575105
Created May 14, 2013 10:47
Chrome Firefoxでfocus出来ないと思ったら setTimeoutが居るらしい、理屈がよくわからん。 クリックイベントの最中にfocus()を他に移すのがNGなんだろうか
//クリックイベントの中で
if(target.find("input").size()>=1){
setTimeout(function(){
//webkit,geckoにはfocus()にsetTimeoutが必要
target.find("input").focus();//入力欄にフォーカス
},0);
}