Resize image map on window resize

前端 未结 7 2023
情话喂你
情话喂你 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:21

    To call a function when the window is resized, try the following:

    $(window).bind('resize', function() {
        // resize the button here
    });
    

    Also, line 37 is missing a dollar sign:

    scaleXY('theMap',(window).width());
    

    It should be:

    scaleXY('theMap',$(window).width());
    

提交回复
热议问题