Skip to content

Instantly share code, notes, and snippets.

@jimmynotjim
Created October 11, 2012 15:05
Show Gist options
  • Save jimmynotjim/78d46e99cac8746e862c to your computer and use it in GitHub Desktop.
Save jimmynotjim/78d46e99cac8746e862c to your computer and use it in GitHub Desktop.
JS for responsive State Maps

I've been using imagemapster.js from http://www.outsharked.com/imagemapster/ for hover effects on the State Maps. It'll resize any image map you use automatically, so there's no need for another script. You have to be sure not to set an inline width or height in the <img> or it'll screw up in IE7-8.

<script type="text/javascript" src="<?php bloginfo( 'template_url' ); ?>/assets/js/jquery.imagemapster.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#usa_image').mapster({
fillOpacity: 0.7,
render_highlight: {
fillColor: '424384',
stroke: true,
strokeColor: 'ffffff'
},
render_select: {
fillColor: '424384',
stroke: false
},
fadeInterval: 50
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment