Click/Unclick states dynamically
In this example, we will select the Texas state by default on page load, but this could be as a result of a user interaction somewhere on the page or because of a url parameter. Then 3 seconds later we will unclick it.
$(function() {
var jsMap = $('#jsmap');
jsMap.JSMaps({
map: 'usa',
onReady: function() {
jsMap.trigger('stateClick', 'Texas');
setTimeout(function() {
jsMap.trigger('stateUnClick', 'Texas');
}, 3000);
}
});
});
Code was copied successfully!