jquery 設置不起作用
一個可能的原因是:在執(zhí)行一段腳本時,對dom的操作不是即時生效的。瀏覽器可能執(zhí)行完當前腳本所有代碼后才真正處理腳本中對dom的操作。因此我在處理這種情況的時候,在settimeout指定的函數中執(zhí)行某個input的focus()方法。
例如:
window.setTimeout("document.getElementById('id').focus();", 50) ;
例如:
window.setTimeout("document.getElementById('id').focus();", 50) ;
posted on 2010-01-07 18:38 mingruofei 閱讀(140) 評論(0) 編輯 收藏