寫好的計(jì)時(shí)器在頁(yè)面內(nèi)顯示正常,瀏覽器切換網(wǎng)頁(yè)后,在回來看頁(yè)面,會(huì)發(fā)現(xiàn)倒計(jì)時(shí)這段過程是暫停的,倒計(jì)時(shí)時(shí)間會(huì)根據(jù)切換網(wǎng)頁(yè)時(shí)的時(shí)間繼續(xù)走下去。比如:頁(yè)面倒計(jì)時(shí)到30秒了,此時(shí)切換網(wǎng)頁(yè),等個(gè)10秒鐘,再回來看原先的頁(yè)面,發(fā)現(xiàn)還是從30秒處繼續(xù)倒計(jì)時(shí)。該如何解決該JS問題?
JS倒計(jì)時(shí)效果,切換網(wǎng)頁(yè)后倒計(jì)時(shí)時(shí)間錯(cuò)誤
飲歌長(zhǎng)嘯
2018-08-09 09:10:12