纯JS实现单独年月日历选择
一般情况下,只是单独年日历或者年月日历这样的时间空间蛮少的,jeDate这个时间控件第一次用,感觉挺全面的,我自己闲着无聊也自己写个小demo实现年月选择,虽然写的很垃圾,但还是记录下,如果有用的话,希望能帮到别人,下面,直接上代码
*
html代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
//需要引入的只有一个jq,这里换下路径就可以了
<script src="../style/lib/jquery/jquery.min.js"></script>
<style>
//这里是我写的一些样式,
input {
padding-left: 5px;
box-sizing: border-box;
width: 250px;
height: 38px;
line-height: 1.3;
line-height: 38px\9;
border-width: 1px;
border-style: solid;
background-color: #fff;
border-radius: 2px;
border-color: #d2d2d2;
}
#data {
position: relative;
}
.dataSelect {
border: 1px solid #d2d2d2;
box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
background-color: #fff;
color: #666;
/* width: 250px; */
height: 230px;
position: abso