Monday, April 27, 2015

Easy jQuery Vector Map onRegionOver to Exclude Regions

Because the Internet doesn't have it yet, here's an easy way to exclude a region from jQuery's popular Vector Maps plugin without excessive code;
onRegionOver:function(event, code, region){
                if(code !== 'tx' && code !== 'hi' && code !== 'ca' && code !== 'ut') {
                        event.preventDefault();
                        document.body.style.cursor = "default";
                    } else {
                        document.body.style.cursor = "pointer";
                    }
                }