View Single Post
Old 12-17-2012, 03:14 AM   PM User | #2
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
Code:
<div id="map" style="width: 600px; height: 500px;"></div>
<div id="info"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://newsignature.github.com/us-map/js/libs/raphael.js"></script>
<script src="http://newsignature.github.com/us-map/js/libs/jquery.usmap.js"></script>

<script>
	$(document).ready(function() {
		$('#map').usmap({
			stateSpecificStyles: {
				'AL': {fill: 'yellow'},
				'MS': {fill: 'yellow'},
				'GA': {fill: 'yellow'},
				'FL': {fill: 'yellow'},
				'TN': {fill: 'yellow'},
				'SC': {fill: 'yellow'},
				'NC': {fill: 'yellow'},
				'VA': {fill: 'yellow'}
			},
		mouseoverState: {
				'AL': function(){showInfo('al')},
				'MS': function(){showInfo('ms')},
				'GA': function(){showInfo('ga')},
				'FL': function(){showInfo('fl')},
				'TN': function(){showInfo('tn')},
				'SC': function(){showInfo('sc')},
				'NC': function(){showInfo('nc')},
				'VA': function(){showInfo('va')} 
			}	
		});
		
	var states={
	al:" here's some AL info",
	ms:"some stuff about MS",
	ga:"the deets for GA",
	fl:"FL contacts",
	tn:"TN information",
	sc:"SC data",
	nc:"our man in NC",
	va:"everything you ever wanted to know about VA*"
	}	
	
	function showInfo(state){
		document.getElementById("info").innerHTML=states[state];
		}
	});
</script>
xelawho is offline   Reply With Quote
Users who have thanked xelawho for this post:
sakina (12-17-2012)