日期:2014-05-16 浏览次数:20480 次
$(function(){ $("#menu li").hover( function () { liuxin=$(this).children("a").css("color","#ffffff"); setTimeout(function(){ liuxin },800); }, function () { }); });
<!DOCTYPE HTML> <html> <head> <meta charset="gb2312" /> <title></title> <script src="http://code.jquery.com/jquery-latest.js"></script> <style> div { width:100px; height:100px; border:1px solid red; } </style> </head> <body> <div> 123 </div> <script> $('div').mouseover(function(){ var t = this; setTimeout(function(){ $(t).css('color', 'red'); }, 800) }) </script> </body> </html>
------解决方案--------------------
$(function(){
$("#menu li").hover(
function () {
setTimeout(function(){
$(this).children("a").css("color","#ffffff");
},800);
},
function () {
});
});
试试