[英]set background color in javascript
我一直在試圖解決這個問題,但是無論我多么努力,似乎都無法正確解決。 我有一個具有星形形狀坐標的mapview。 懸停時,星星會更改顏色,單擊時會打開一個鏈接。 如何設置背景顏色? (不是懸浮顏色,我明白了。只是主要的。代碼:
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;
});
}
我嘗試的所有內容都會出錯。 :(
如果您使用的是jQuery ui 1.9+,請嘗試使用backgroundColor
代替fill
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.