我有不断计算值的函数我在按下按钮时试图存储这些函数的值但是当我尝试下面的代码时它不起作用。当按钮暂停时,如何在变量中捕获它?
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));
答案 0 :(得分: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();