2016-06-11 5 views
-1

に私がjqvampプラグインを使用していると私は(別のボタンをクリックして)動的にselectedColorプロパティを変更したいと思いますが、私はどのようにそれを把握することはできません。変更selectedColorは動的jqvamp

+0

私はjqvamp' 'については考えているが、あなたはJSを使用してそれを達成することができ、私はサンプルコードを書くことができます動作します希望 – Ramkee

答えて

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); 
}); 

これは

関連する問題