一款精简的JQ日历插件

最终效果如图所示,日历图标可自行修改html,这里未作上传。

 

本人用的jq+angular,最后的值,可以通过   $("#laydateInput").val()   拿到。

html:

 <div class="laydate-box">
                            <input type="text" id="laydateInput" placeholder="xxxx年xx月xx日" ng-model="foundingTime" />
                            <img src="${basePath}/resources/images/personal/calendar.png" alt="" class="icon data-icon"/>
                            <div class="select-date">
                                <div class="select-date-header">
                                    <ul class="heade-ul">
                                        <li class="header-item header-item-one">
                                            <select name="" id="yearList"></select>
                                        </li>
                                        <li class="header-item header-item-two" onselectstart="return false">
                                            <select name="" id="monthList"></select>
                                        </li>
                                        <li class="header-item header-item-three" onselectstart="return false" >
                                            <span class="reback">回到今天</span>
                                        </li>
                                    </ul>
                                </div>
                                <div class="select-date-body">
                                    <ul class="week-list">
                                        <li>日</li><li>一</li><li>二</li><li>三</li><li>四</li><li>五</li><li>六</li>
                                    </ul>
                                    <ul class="day-tabel"></ul>
                                </div>
                            </div>
                        </div>

 

css:


li{
	list-style: none;
}
.icon{
	position: absolute;
	top: 4px;
	right: 15px;
	height: 25px;
	width: 25px;
	background: #fff;
}
.laydate-box{
	height: 34px;
	width: 154px;
	border: none;
	margin: 100px 0 0 200px;	
	position: relative;
}
#laydateInput{
	outline: none;
	display: block;
	height: 30px;
	width: 150px;
	font-size: 16px;
	line-height: 30px;	
}
.select-date{
	position: absolute;
	left: 0px;
	top:35px;
	width: 266px;
	height: 301px;
	border: 1px solid #58abff;
	display: none;
	background-color: #fff;
	z-index: 1;
}
.select-date-header{
	height: 48px;
	border-bottom: 1px solid #58abff;
}
.heade-ul{
	height: 49px;
}
.header-item{
	height: 28px;
	float: left;
	margin-top: 9px;
}
.header-item select{
	width: 50px;
	height: 28px;
}
.header-item-one select{
	width: 68px;
	margin-left: 10px;
	height: 30px;
	outline: none;
}
.header-item-one{
	height: 30px;
}
.header-item-two i{
	display: block;
	float: left;
	height: 28px;
	width: 28px;
	line-height: 28px;
	text-align: center;
	cursor: pointer;
}
.header-item-two i{
	display: block;
	float: 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值