我的代码截取如下:
var handle = null;
$("#div_menu_1_con a").mouseover(function () {
handle = setTimeout(changethis(???), 3000);
}).mouseout(function () {
clearTimeout(handle);
});
function changethis(selector){。。。。。。};上面???处就是要将当前发生mouseover的元素传给changethis函数,让它去处理一些事情!
jQuery绑定mouseover方法是
$("#元素id").mouseover(function(){
//将mouseover所在元素传递赋值给其所在内部函数,就是将元素本身传递给内部函数
//jQuery中元素绑定函数内$(this)就可以获取到当前元素
//所以,如下调用
show($(this));//$(this)将当前元素当作参数传递过去
});
function show(obj){
alert(obj.text());
}$("#div_menu_1_con a").mouseover(function () {
var activeElement=this;
handle = setTimeout(function(){
changethis(activeElement);
}, 3000);
}).mouseout(function () {
clearTimeout(handle);
});
function changethis(selector){。。。。。。};this 呀 直接this就可以了










