比如原来的
<a herf="#" mouseover="aaa(1)">a1</a>
<a herf="#" mouseover="aaa(2)">a2</a>var arr=[];
function aaa(i)
{
alert(arr[i]);
}现在用jQuery的绑定消息函数<a herf="#" class="abc">a1</a>$("a.abc").mouseover(function(这里咋传参数啊){});
<a herf="#" mouseover="aaa(1)">a1</a>
<a herf="#" mouseover="aaa(2)">a2</a>var arr=[];
function aaa(i)
{
alert(arr[i]);
}现在用jQuery的绑定消息函数<a herf="#" class="abc">a1</a>$("a.abc").mouseover(function(这里咋传参数啊){});
<a herf="#" class="abc">a1</a>$(".abc").mouseover(function(index){
alert(arr[index]);
});
<a herf="#" index="0">a1</a>这样 。
继续调用aaa方法。
$("a.abc").mouseover(function(){
aaa($(this).attr("index"));
});
<a herf="#" class="abc">a1</a>$(".abc").mouseover(function(index){
alert(arr[index+1]);
});
看看这样行不行?