0
我写了这个scirpt:自定义jQuery的功能和参数
$(document).ready(function() {
$('#tb1 li').hover(function() {
var head = $(this).attr("title");
var image = $(this).find("a").attr("rel");
$('.aCnt img').attr("src", image);
$('.aCnt span').html(head);
});
$('#tb1 li').eq(0).hover();
});
我想使这个脚本全球
function interActive(myID, myClass){
ID = '#' + myID;
cls = '.' + myClass;
$('ID li').hover(function() {
var head = $(this).attr("title");
var image = $(this).find("a").attr("rel");
$('cls img').attr("src", image);
$('cls span').html(head);
});
$('ID li').eq(0).hover();
}
我知道,jQuery函数没有类似例如PHP函数。 interActive
函数在jQuery中不起作用。我如何修改jQuery的这个函数? 在此先感谢。
感谢您的帮助。请看这里:http://jsfiddle.net/EkKSS/1/。盘旋没有任何变化。 – TheNone 2011-01-12 00:18:49