Correction : Le plugin récupérait la taille de l'image redimensionnée et non celle de l'image originale. Après correction, il récupère la taille de l'image originale. Renomage du plugin en "jquery.mapResizer.js" pour éviter les confusions Merci à l'auteur originale de ce plugin. repository original : https://github.com/stowball/jQuery-rwdImageMaps
exemple ici : https://oritheque.fr/_JJD/jquery.mapResizer/exemple-01.html
links : https://gist.github.com/rictorres/6159438 https://github.com/stowball/jQuery-rwdImageMaps https://github.com/JJDai54/jquery.mapResizer/blob/master/js/jquery.mapResizer.js
//-----------------------------------------------------------------------------
Allows image maps to be used in a responsive design by recalculating the area coordinates to match the actual image size on load and window.resize
- If possible, add correct, unitless
widthandheightattributes to your image map images. You can override these in CSS to make them responsive. - Add a link to jQuery in your page, preferably at the bottom just before the closing
</body> - After jQuery, either in a
<script>block or a separate file, call:
$('img[usemap]').rwdImageMaps();You may also want to wrap it inside a $(document).ready() function, like so:
$(document).ready(function(e) {
$('img[usemap]').rwdImageMaps();
});http://mattstow.com/experiment/responsive-image-maps/rwd-image-maps.html
Copyright (c) 2016 Matt Stow
Licensed under the MIT license (see LICENSE for details)
Minified version created with Online YUI Compressor: http://www.refresh-sf.com/yui/