我是 jQuery 的新手,我有一个带有高亮插件的地图,当鼠标悬停在一个区域上时,我想用 ID 更改 div 中的文本,我将从区域属性 Alt="some text "
这是用于区域循环的代码,我很确定我可以在这里添加一个小函数,但我想不通。
//map
clicks$(".tabs area").click(function(){
//areas loop:
$(".tabs area").each(function(){
var d = $(this).data('maphilight') || {};
if(d.alwaysOn == true){
d.alwaysOn = false;
}
});
var data = $(this).data('maphilight') || {};
data.alwaysOn = true;
$(this).data('maphilight', data).trigger('alwaysOn.maphilight');
if ($(this).hasClass("current") == false)
{
var thisTarget = $(this).attr("href");
$(this).parents(".tabs").find('area.current').removeClass('current');
$(this).addClass('current');
$(this).parents(".tabs").nextAll(".tab-content").children(":visible").fadeOut(1, function() {
$(thisTarget).fadeIn("fast");
});
}
return false;
});
任何关于我如何完成这项工作的帮助或建议将不胜感激。