I have written this scirpt:
$(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();
});
I want to make this script global
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();
}
I know that jQuery function not similar to for example php functions. The interActive functions will not work in jQuery. How can I modify this function for jQuery?
Thanks in advance.