Skip to content

Instantly share code, notes, and snippets.

@iguu
Created May 14, 2013 10:47
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iguu/5575105 to your computer and use it in GitHub Desktop.
Save iguu/5575105 to your computer and use it in GitHub Desktop.
Chrome Firefoxでfocus出来ないと思ったら setTimeoutが居るらしい、理屈がよくわからん。 クリックイベントの最中にfocus()を他に移すのがNGなんだろうか
//クリックイベントの中で
if(target.find("input").size()>=1){
setTimeout(function(){
//webkit,geckoにはfocus()にsetTimeoutが必要
target.find("input").focus();//入力欄にフォーカス
},0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment