How To Make Banner Image Maps Responsive
Many of our customers use image maps in their LibGuides v.1 banners. Image maps are not, by nature, responsive. Here's some code you can use to make them responsive.
- Create a new image map or modify an existing map. Make sure the name and ID of the map are changed to
usemap
. - Add
class="img-responsive"
andusemap="#usemap"
to the image code. - Go here and save the JavaScript file.
- Upload this file to the client's Custom Head > Customization Files area.
- Add the resulting
<script>
code to the top of the custom HEAD. -
Add this code to the custom footer.
<script type="text/javascript">
$('img[usemap]').rwdImageMaps();
</script> - Test to make sure everything looks and works as expected.