From acc7971b96621902be8254451af59802a642f24e Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 17 Aug 2011 20:57:58 +0200 Subject: [PATCH] event.offsetX does not work in Firefox --- source/Ox.UI/js/Video/Ox.VideoPreview.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/Ox.UI/js/Video/Ox.VideoPreview.js b/source/Ox.UI/js/Video/Ox.VideoPreview.js index e825af5c..59b0b8fa 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPreview.js +++ b/source/Ox.UI/js/Video/Ox.VideoPreview.js @@ -35,7 +35,8 @@ Ox.VideoPreview = function(options, self) { self.$interface = Ox.Element({ tooltip: function(event) { - var position = getPosition(event.offsetX); + //event.offsetX does not work in Firefox + var position = getPosition(event.clientX - that.offset().left); self.$frame.attr({src: self.options.getFrame(position)}); return Ox.formatDuration(position, 2); } @@ -53,7 +54,8 @@ Ox.VideoPreview = function(options, self) { function click(e) { that.triggerEvent('click', { - position: getPosition(e.offsetX) + //e.offsetX does not work in Firefox + position: getPosition(e.clientX - that.offset().left) }); } @@ -108,4 +110,4 @@ Ox.VideoPreview = function(options, self) { return that; -}; \ No newline at end of file +};