如果最终使用Javascript完成任务,则可以使用以下跨浏览器代码段来调整
MAP元素中所有区域的大小。
window.onload = function () { var ImageMap = function (map) { var n, areas = map.getElementsByTagName('area'), len = areas.length, coords = [], previousWidth = 1920; for (n = 0; n < len; n++) { coords[n] = areas[n].coords.split(','); } this.resize = function () { var n, m, clen, x = document.body.clientWidth / previousWidth; for (n = 0; n < len; n++) { clen = coords[n].length; for (m = 0; m < clen; m++) { coords[n][m] *= x; } areas[n].coords = coords[n].join(','); } previousWidth = document.body.clientWidth; return true; }; window.onresize = this.resize; }, imageMap = new ImageMap(document.getElementById('map_ID')); imageMap.resize();}previousWidth必须等于原始图像的宽度。您还需要在HTML中使用一些相对单位:
<div ><img id="Image-Maps_5201211070133251" src="Site.png" usemap="#Image-Maps_5201211070133251" border="0" width="100%" alt="" />



