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({
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)
});
}