【问题标题】:Change selectedColor dynamically in jqvamp在 jqvamp 中动态更改 selectedColor
【发布时间】:2016-06-11 10:04:42
【问题描述】:

我正在使用jqvamp 插件,我想动态更改selectedColor 属性(通过单击另一个按钮),但我不知道如何。

【问题讨论】:

  • 我不知道jqvamp但是你可以用JS来实现,我可以写示例代码

标签: javascript html dictionary svg


【解决方案1】:
var your_variable = "";
// solution 1
// by click 
$('#your_button').click(function(){
your_variable= target_color;
// run the initialization again
test();
});

function test(){
set = $('#map').vectorMap({
//...code
selectedColor: your_variable
//...code
});
}

// solution 2
$('#your_button').click(function(){
$('#map').vectorMap("set", "selectedColor", your_variable);
});

希望这可行

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-01-19
    • 1970-01-01
    • 2017-12-03
    • 2014-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多