87,910
社区成员
发帖
与我相关
我的任务
分享
$(document).ready(function(){
var t;
$(".ul1 li").mouseover(function(){
//t = setTimeout("alert('hello~ boy')", 3000 );
//setTimeout第一个参数是放函数
t = setTimeout(function(){alert('hello~ boy')}, 3000 );
nowStr=$(this).html();
})
$(".ul1 li").mouseout(function(){
clearTimeout(t);
nowStr="";
})
})
页面:
<ul class="ul1">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>