我已经创建了一个饼图,现在使用ImageMapster对其进行样式设置。当我单击一块饼时,我希望所有其他块都成为选中(不透明),但不是我单击的那块。
有谁知道如何做到这一点吗?
到目前为止我的代码如下:
$('.pie').mapster({
stroke: true,
strokeOpacity: 1.0,
strokeColor: '000000',
strokeWidth: 1,
singleSelect: true,
fill: true,
fillColor: '0000ff',
fillOpacity: 0.25,
render_select:
{
fillOpacity: 0.75,
fillColor: '000000'
},
render_highlight:
{
fillOpacity: 0.5,
fillColor: '00ff00'
},
onClick: function(e) {
// Select all pies but not this one.
$('.pie area').mapster('select');
}
});发布于 2013-04-16 22:41:42
这应该是可行的:
onClick: function(e) {
// unselect the clicked one
$(this).mapster('deselect');
// Select all pies but not this one.
$('.pie area').not(this).mapster('select');
// prevent default click handling
return false;
}https://stackoverflow.com/questions/16039638
复制相似问题