jquery簡單倒計(jì)時(shí)實(shí)現(xiàn)方法
本文實(shí)例講述了jquery簡單倒計(jì)時(shí)實(shí)現(xiàn)方法。分享給大家供大家參考,具體如下:
var intDiff = parseInt(60); //倒計(jì)時(shí)總秒數(shù)量 function timer(intDiff) { window.setInterval(function () { var day = 0, hour = 0, minute = 0, second = 0; //時(shí)間默認(rèn)值 if (intDiff > 0) { day = Math.floor(intDiff / (60 * 60 * 24)); hour = Math.floor(intDiff / (60 * 60)) - (day * 24); minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60); second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60); } if (minute <= 9) minute = '0' + minute; if (second <= 9) second = '0' + second; $('#day_show').html(day + "天"); $('#hour_show').html('<s id="h"></s>' + hour + '時(shí)'); $('#minute_show').html('<s></s>' + minute + '分'); $('#second_show').html('<s></s>' + second + '秒'); intDiff--; }, 1000); } $(function () { timer(intDiff); });
希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。
- jQuery倒計(jì)時(shí)代碼(超簡單)
- jquery實(shí)現(xiàn)手機(jī)發(fā)送驗(yàn)證碼的倒計(jì)時(shí)代碼
- jQuery實(shí)現(xiàn)發(fā)送驗(yàn)證碼并60秒倒計(jì)時(shí)功能
- 利用jQuery實(shí)現(xiàn)漂亮的圓形進(jìn)度條倒計(jì)時(shí)插件
- jquery 倒計(jì)時(shí)效果實(shí)現(xiàn)秒殺思路
- jQuery 點(diǎn)擊獲取驗(yàn)證碼按鈕及倒計(jì)時(shí)功能
- jQuery 實(shí)現(xiàn)倒計(jì)時(shí)天,時(shí),分,秒功能
- jquery實(shí)現(xiàn)可關(guān)閉的倒計(jì)時(shí)廣告特效代碼
- jQuery實(shí)現(xiàn)商品活動(dòng)倒計(jì)時(shí)
- JS/jquery實(shí)現(xiàn)一個(gè)網(wǎng)頁內(nèi)同時(shí)調(diào)用多個(gè)倒計(jì)時(shí)的方法
- jQuery實(shí)現(xiàn)倒計(jì)時(shí)功能完整示例
相關(guān)文章
jQuery+CSS實(shí)現(xiàn)菜單滑動(dòng)伸展收縮(仿淘寶)
淘寶網(wǎng)上的菜單滑動(dòng)伸展收縮想必大家不會(huì)很陌生吧,接下來本文也使用jquery+css實(shí)現(xiàn)一個(gè),代碼很簡潔功能很使用,感興趣的各位可以不要錯(cuò)過了哈2013-03-03jquery編寫彈出信息提示條并延時(shí)滑出動(dòng)畫實(shí)現(xiàn)示例
這篇文章主要為大家介紹了jquery編寫彈出信息提示條并延時(shí)滑出動(dòng)畫實(shí)現(xiàn)示例,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-08-08jquery實(shí)現(xiàn)動(dòng)態(tài)菜單的實(shí)例代碼
這篇文章主要介紹了jquery實(shí)現(xiàn)動(dòng)態(tài)菜單的實(shí)例代碼。需要的朋友可以過來參考下,希望對(duì)大家有所幫助2013-11-11jquery滾動(dòng)條插件jScrollPane的使用介紹
jScrollPane想必大家都不陌生吧它就是所謂的jquery滾動(dòng)條插件,下面為大家介紹下其具體的使用,感興趣的朋友不要錯(cuò)過2013-11-11jquery實(shí)現(xiàn)先淡出再折疊收起的動(dòng)畫效果
這篇文章主要介紹了jquery實(shí)現(xiàn)先淡出再折疊收起的動(dòng)畫效果,通過jquery鏈?zhǔn)讲僮鲗?shí)現(xiàn)頁面元素的漸變折疊與展開功能,非常簡單實(shí)用,需要的朋友可以參考下2015-08-08jQuery實(shí)現(xiàn)下拉菜單(內(nèi)容為時(shí)間)的實(shí)時(shí)更新及圖表的隨動(dòng)更新的方法
這篇文章主要介紹了實(shí)現(xiàn)下拉菜單(內(nèi)容為時(shí)間)的實(shí)時(shí)更新及圖表的隨動(dòng)更新的方法的相關(guān)資料,需要的朋友可以參考下2016-07-07