Created
July 6, 2016 17:37
-
-
Save davidchc/c36405c9d3f9cea5a4f42808b63a332a 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
var code = '#' + $('#content-code').val(); | |
var target = $(code); | |
var timeInSeconds = $('#timeinseconds'); | |
var progress = $(code + ' .c100'); | |
vid.addEventListener('timeupdate', function() { | |
var seconds = vid.currentTime; | |
var duration = vid.duration; | |
var percentual = float2int((seconds/duration)*100); | |
timeInSeconds.html(percentual+'%'); | |
if(percentual != 100){ | |
progress.addClass('p'+percentual); | |
} else{ | |
target.addClass('timelineChecked'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment