一个简单的时间插件

本文分享了一个简单实用的jQuery日期选择器插件,通过简单的调用即可实现日期的选择,并支持自定义回调事件。该插件能够显示节假日,并提供丰富的样式定制。

在此分享一个简单好用的jqury时间插件

展示代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>显示节假日的jQuery日期选择器代码</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/hDate.js"></script>
<link href="hDate.css" rel="stylesheet" />
<style type="text/css">
html, body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
outline:none;
}
#Text1,#Text2{padding:7px 5px;outline:none;width:200px;border-radius:3px;border:1px solid #ccc;}
</style>
</head>
<body>
<div style="width:520px;margin:40px auto 0 auto;"> 
简单调用:<input id="Text1" onClick="calendar.show({ id: this })" type="text" /><br/><br/>
回调事件:<input id="Text2" type="text" />
</div>
<script type="text/javascript">
$("#Text2").click(function (e) {
var ths = this;
calendar.show({
id: this, ok: function () {
alert(ths.value);
}
});
});
</script>
</body>
</html>


还有js、css等具体代码:

链接: http://pan.baidu.com/s/1gfHswXt 密码: c6zc

在C#中创建一个简单的桌面倒计时插件,你可以使用Windows Forms库,它提供了一套丰富的控件和事件处理机制。以下是步骤概述: 1. **项目设置**: - 创建一个新的Windows Forms应用程序项目。 - 可以选择`Visual Studio` -> `文件` -> `新建` -> `项目` -> `Windows 应用程序 (.NET Framework)`。 2. **界面设计**: - 添加一个`Timer`控件到窗体上,这将用于定时更新倒计时。 - 可能还需要添加一个`Label`控件显示倒计时数字。 - 调整控件的布局使其看起来像一个倒计时器。 3. **代码编写**: - 设置倒计时属性: ```csharp private int countdownSeconds; ``` - 初始化和开始倒计时: ```csharp private void Form_Load(object sender, EventArgs e) { countdownSeconds = yourDesiredCountdownInSeconds; timer1.Interval = 1000; // 每秒更新一次 timer1.Start(); } ``` 4. **倒计时更新**: ```csharp private void timer1_Tick(object sender, EventArgs e) { if (countdownSeconds > 0) { countdownSeconds--; label1.Text = "倒计时: " + countdownSeconds.ToString(); // 更新标签显示剩余时间 } else { timer1.Stop(); label1.Text = "结束"; // 倒计时结束后显示提示信息 } } ``` 5. **停止倒计时**: 如果需要暂停或停止倒计时,可以在适当的地方添加一个按钮事件处理函数,如`buttonStop_Click`,调用`timer1.Stop()`即可。 6. **测试和调试**: 编写完成后,运行程序并测试倒计时是否按照预期工作。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值