0

我有不断计算值的函数我试图在按下按钮时存储这些函数的值但是当我尝试下面的代码时它不起作用。那么当按钮暂停时,如何在变量中捕获它?

songposition = $("#songCurrentpos").text(pad(Math.floor(current / 60), 2) + ":" + pad(Math.floor(current % 60), 2));

songlength = $("#songDuration").text(pad(Math.floor(duration / 60), 2) + ":" + pad(Math.floor(duration % 60), 2));

4

1 回答 1

0
// Set the values
$("#songCurrentpos").text(pad(Math.floor(current / 60), 2) + ":" + pad(Math.floor(current % 60), 2));
$("#songDuration").text(pad(Math.floor(duration / 60), 2) + ":" + pad(Math.floor(duration % 60), 2));

// Get the values
songposition = $("#songCurrentpos").text();
songlength = $("#songDuration").text();
于 2013-04-14T17:56:40.863 回答