我期待延緩這個函數運行3秒鐘:延遲運行一個功能3秒鐘?
<script type="text/javascript">
$('#FormsPageID table tr:nth-child(12) td:nth-child(2) div span span input')
.on('focus', function(){
var $this = $(this);
if($this.val() == '4/11/2013'){
$this.val('');
}
})
.on('blur', function(){
var $this = $(this);
if($this.val() == ''){
$this.val('4/11/2013');
}
});
</script>
我遇到的例子都涉及使用的setTimeout或X秒後顯示的元素。但我不確定這將如何適用於我的功能。
你想推遲什麼?你綁定事件的部分,還是你想延遲事件的主體? – zzzzBov 2013-04-11 14:43:06