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" />
相關文章
JQuery操作表格(隔行著色,高亮顯示,篩選數(shù)據(jù))
最近項目里對表格的操作比較多。以往我們要做一些效果的時候往往通過程序代碼來實現(xiàn),這個努力不值,因為JQuery是完全可以做到的,并且是客戶端運行,不經(jīng)過服務器處理,給用戶的反應快,也減少了服務器壓力2012-02-02

