Skip to content

Commit

Permalink
Merge pull request #1 from monrus/dev_css3_fix
Browse files Browse the repository at this point in the history
Bugfix for position element when use css3 transformations
  • Loading branch information
monrus authored Mar 5, 2017
2 parents c8f3c9e + 127eb7d commit 67a8418
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 30 deletions.
11 changes: 2 additions & 9 deletions audiojs/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,21 +309,14 @@
if (!audio.settings.createPlayer) return;
var player = audio.settings.createPlayer,
playPause = getByClass(player.playPauseClass, wrapper),
scrubber = getByClass(player.scrubberClass, wrapper),
leftPos = function(elem) {
var curleft = 0;
if (elem.offsetParent) {
do { curleft += elem.offsetLeft; } while (elem = elem.offsetParent);
}
return curleft;
};
scrubber = getByClass(player.scrubberClass, wrapper);

container[audiojs].events.addListener(playPause, 'click', function(e) {
audio.playPause.apply(audio);
});

container[audiojs].events.addListener(scrubber, 'click', function(e) {
var relativeLeft = e.clientX - leftPos(this);
var relativeLeft = e.clientX - this.getBoundingClientRect().left;
audio.skipTo(relativeLeft / scrubber.offsetWidth);
});

Expand Down
Loading

0 comments on commit 67a8418

Please sign in to comment.