【发布时间】:2012-10-16 21:39:46
【问题描述】:
我一直在尝试解决这个问题,但似乎无论我多么努力,我似乎都无法正确解决。我有一个带有星形坐标的地图视图。星星在悬停时会改变颜色,并在点击时打开一个链接。你如何设置背景颜色? (不是悬停颜色,我明白了。只是主要的。代码:
for (var country in onestar) {
var obj = r.path(onestar[country].path);
obj.attr(attributes);
arr[obj.id] = country;
obj
.hover(function(){
this.animate({
fill: '#41464e'
}, 300);
}, function(){
this.animate({
fill: attributes.fill
}, 300);
})
.click(function(){
window.open('http://www.yahoo.com/')
});
$('.point').find('.close').live('click', function(){
var t = $(this),
parent = t.parent('.point');
parent.fadeOut(function(){
parent.remove();
});
return false;
});
}
我尝试的每件事都会出错。 :(
【问题讨论】:
-
能否提供完整代码,最好是jsfiddle.net
-
您所做的似乎不是标准的 DOM 事情。这是 Raphael 应用程序吗?
标签: javascript jquery colors background