event.offsetX does not work in Firefox

This commit is contained in:
j 2011-08-17 20:57:58 +02:00
parent 5e283c3759
commit acc7971b96

View file

@ -35,7 +35,8 @@ Ox.VideoPreview = function(options, self) {
self.$interface = Ox.Element({ self.$interface = Ox.Element({
tooltip: function(event) { 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)}); self.$frame.attr({src: self.options.getFrame(position)});
return Ox.formatDuration(position, 2); return Ox.formatDuration(position, 2);
} }
@ -53,7 +54,8 @@ Ox.VideoPreview = function(options, self) {
function click(e) { function click(e) {
that.triggerEvent('click', { 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; return that;
}; };