Created
June 11, 2012 01:24
-
-
Save milushov/2908003 to your computer and use it in GitHub Desktop.
http://vk.com/audio total duration of searched tracks
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 total_time = function() { | |
var durs_sourse = [], total = 0; | |
$('.duration').each(function(i,v){ durs_sourse.push( $(v).html() ); }) | |
for(v in durs_sourse) { | |
total += parseInt(durs_sourse[v].split(':')[0]*60) + parseInt(durs_sourse[v].split(':')[1]) | |
} | |
return 'всего ' + (total/(60*60)).toFixed() + ' час. ' + (total%(60)) + ' мин.'; | |
} | |
total_time(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this need jquery