event.offsetX in Firefox

后端 未结 11 1820
既然无缘
既然无缘 2020-11-27 16:45





        
11条回答
  •  渐次进展
    2020-11-27 17:02

    From a JQuery bug tracker page - a nice polyfill is this:

    var offX  = (e.offsetX || e.pageX - $(e.target).offset().left);
    

    .. where e is the event returned from a jquery event. Obviously, only if you've got Jquery already on your project, otherwise will have to do the offset() stuff manually.

提交回复
热议问题