Jquery 綁定時間實現(xiàn)代碼
更新時間:2011年05月03日 22:51:29 作者:
jquery 顯示本地時間/ 帶日期、星期/ UTC,需要的朋友可以參考下。
引用jquery 庫:<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.jclock.js"></script>
$(function() {
$('#demo').jclock();
$('#local').click(function() { $('#demo').jclock() });
$('#with').click(function() { $('#demo').jclock({ withDate: true, withWeek: true }) });
$('#utc').click(function() { $('#demo').jclock({ withDate: true, utc: true }) });
});
前臺代碼:
<div id="demo"></div>
<input type="button" id="local" value="本地時間" />
<input type="button" id="with" value="帶日期、星期" />
<input type="button" id="utc" value="UTC" />
<script type="text/javascript" src="jquery.jclock.js"></script>
復制代碼 代碼如下:
$(function() {
$('#demo').jclock();
$('#local').click(function() { $('#demo').jclock() });
$('#with').click(function() { $('#demo').jclock({ withDate: true, withWeek: true }) });
$('#utc').click(function() { $('#demo').jclock({ withDate: true, utc: true }) });
});
前臺代碼:
復制代碼 代碼如下:
<div id="demo"></div>
<input type="button" id="local" value="本地時間" />
<input type="button" id="with" value="帶日期、星期" />
<input type="button" id="utc" value="UTC" />
相關(guān)文章
jquery構(gòu)造器的實現(xiàn)代碼小結(jié)
jQuery的$符號非常神奇,它可以接受一個字符,也可以接受一個文檔對象或window對象,亦可以傳個函數(shù)進行變?yōu)閐omReady加載器2011-05-05
jquery 獲取 outerHtml 包含當前節(jié)點本身的代碼
jQuery.html() 是獲取當前節(jié)點下的html代碼,并不包含當前節(jié)點本身的代碼,后來實驗發(fā)現(xiàn)有一個jQuery的一個方法可以解決2014-10-10

