-
-
Save lustremedia/788b8fd639462bc31ca5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.jp-volume-bar').mousedown(function() { | |
var parentOffset = $(this).offset(), | |
width = $(this).width(); | |
$(window).mousemove(function(e) { | |
var x = e.pageX - parentOffset.left, | |
volume = x/width | |
if (volume > 1) { | |
$("#JPID").jPlayer("volume", 1); | |
} else if (volume <= 0) { | |
$("#JPID").jPlayer("mute"); | |
} else { | |
$("#JPID").jPlayer("volume", volume); | |
$("#JPID").jPlayer("unmute"); | |
} | |
}); | |
return false; | |
}) | |
.mouseup(function() { | |
$(window).unbind("mousemove"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment