if(stopwatch >= track[song].duration)
track[song].duration
находит длительность звуковой дорожки.
Я хочу создать функцию секундомера, которая начнет считать миллисекунды, когда вы нажмете на swap
ID stopwatch
, чтобы, когда функция была нажата на определенное количество времени, функция if что-то сделает. В моем случае замените изображение. А также, что функция будет reset сама при повторном нажатии.
так что stopwatch
= current time
- clicked time
Как настроить clicked time
current time
= new Date().getTime();
? И это в миллисекундах?
$('#swap').click(function()...