日期:2014-05-16 浏览次数:20509 次
<ul id="list"> <li> <a href="" title="iphone_ios">苹果</a> <div class="popDiv"> </div> </li> <li> <a href="" title="安卓_java">google</a> <div class="popDiv"> </div> </li> <li> <a href="" title="wp">微软</a> <div class="popDiv"> </div> </li> <li> <a href="" title="mysql">甲骨文</a> <div class="popDiv"> </div> </li> <li> <a href="" title="全球最大的社交网站">facebook</a> <div class="popDiv"> </div> </li> </ul> var list = document.getElementById("list"); var oli = list.getElementsByTagName("li"); for(var i=0; i<oli.length; i++){ oli[i].onmouseover = function(){ setTimeout(arguments.callee,20); console.log(this); } }
var list = document.getElementById("list"); var oli = list.getElementsByTagName("li"); for(var i=0; i<oli.length; i++) { oli[i].onmouseover = function(){ var self = this; var callee = arguments.callee; setTimeout(function(){callee.call(self)},20); console.log(this); } }