Resize image map on window resize

前端 未结 7 2033
情话喂你
情话喂你 2020-12-20 18:59

I\'m trying to resize an image map on window resize event. The closest I\'ve gotten is to use a mouseclick event, but it needs to be window resize for what I\'m doing. I\'m

7条回答
  •  情深已故
    2020-12-20 19:41

    This is an old thread but for anyone looking for a solution for a similar or even identical problem, the ImageMapster jQuery plugin appears to provide the easiest solution. You can use its resize method (which can even animate the resizing if desired!) as follows to resize an image along with its image map:

    $('img').mapster( 'resize', newWidth, newHeight, resizeTime);
    

    You can find a link on ImageMapster's demo page to a jsFiddle that demonstrates resizing an image & its map in response to changing the browser window.

提交回复
热议问题