jquery编写的简单日历

时间:2022-05-13 21:07:26

以前在开发web页面的时候遇到日历,都是直接引入一些日历组件来用,一直不太明白实现原理,总感觉挺复杂的。

今天尝试着用jquery写了一个简单的日历功能,可以选择年份,月份,返回今天,原来简单的日历功能自己也是可以写的。至于日历中的其他一些强大功能相信只要努力,也是可以实现的。

下面贴出实现的代码,供小伙伴们参考,希望对你们有一些帮助。

一、首页是html代码,其中的css,js引入路径和文件名需要自己改一下,其中我用的是jquery的1.8.3,可以引入其他更高版本,自行引入。

 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>日历</title>
<link rel="stylesheet" href="css/style.css">
<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/demo.js"></script>
</head>
<body>
<div class="main clearfix">
<div class="menu clearfix">
<div class="select fl pr">
<ul class="select-list select-year pa none">
<li value="2015">2015年</li>
<li value="2016">2016年</li>
<li value="2017">2017年</li>
</ul>
<div class="select-text year"><span class="year-text" value="2016">2016年</span>▼</div>
</div>
<a class="select-prev fl" href="javascript:;">&lt;</a>
<div class="select month fl pr">
<ul class="select-list pa none">
<li value="1">1月</li>
<li value="2">2月</li>
<li value="3">3月</li>
<li value="4">4月</li>
<li value="5">5月</li>
<li value="6">6月</li>
<li value="7">7月</li>
<li value="8">8月</li>
<li value="9">9月</li>
<li value="10">10月</li>
<li value="11">11月</li>
<li value="12">12月</li>
</ul>
<div class="select-text"><span class="month-text" value="1">1月</span>▼</div>
</div>
<a class="select-next fl" href="javascript:;">&gt;</a>
<a class="select-today fl" href="javascript:;">返回今天</a>
<div class="time fl">10:40:05</div>
</div>
<ul class="title">
<li>日</li><li>一</li><li>二</li><li>三</li><li>四</li><li>五</li><li>六</li>
</ul>
<ul class="table">
<li><span>1</span></li><li><span>2</span>
</ul>
</div>
</body>
</html>

二、接下来是css样式

 *{margin:;padding:;font-family: '微软雅黑';}
body{background: #fff;}
ul{list-style: none;}
a{text-decoration: none;color:#333;}
img{border:none;}
.fl{float:left;_display:inline;}
.fr{float:right;_display:inline;}
.pr{position: relative;}
.pa{position: absolute;}
.none{display: none;}
.clearfix:before,.clearfix:after{content:"";display:table;}
.clearfix:after{clear:both;}
.clearfix{*zoom:;} .main{width:385px;margin:20px auto;padding:10px;border:2px #57abff solid;color:#333;}
.menu{font-size: 14px;}
.select{width:80px;height:25px;line-height:25px;border:1px #d8d8d8 solid;cursor: default;}
.select-text{text-align: center;}
.select-text:hover{box-shadow: 1px 1px 0 0 #d8d8d8 inset;}
.select div.current{box-shadow: 1px 1px 0 0 #d8d8d8 inset;}
.month{border-left:none;border-right:none;}
.select-list{left:-1px;top:25px;width: 80px;max-height:360px;background: #fff;border:1px #d8d8d8 solid;overflow: auto;}
.select-list li{height: 30px;line-height: 30px;text-indent: 10px;cursor: pointer;}
.select-list li.selected{background: #d8d8d8;}
.select-list li.on{background: #d8d8d8;}
.select-prev,.select-next{width:25px;height: 25px;margin-left:10px;line-height: 25px;text-align: center;border:1px #d8d8d8 solid;cursor: pointer;}
.select-next{margin:;}
.select-today{width:80px;height: 25px;margin-left:10px;line-height: 25px;text-align: center;border:1px #d8d8d8 solid;cursor: pointer;}
.select-prev:hover,.select-next:hover,.select-today:hover{border:1px #57abff solid;}
.select-prev:active,.select-next:active,.select-today:active{background: #f0f0f0;box-shadow: 1px 1px 1px #c7c7c7 inset;}
.time{height: 25px;margin-left:10px;line-height: 25px;}
.title{height:35px;font-size: 16px;margin-top:10px;border-top:1px #57abff solid;}
.title li{float:left;width:55px;height:35px;line-height: 35px;text-align: center;}
.table li{float:left;width:55px;height:55px;border-bottom: 1px #c8cacc solid;font-size: 18px;cursor: pointer;}
.table li span{display: block;width:51px;height:51px;line-height: 51px;text-align: center;border:2px #fff solid;}
.table li span.on{border:2px #fb0 solid;}
.table li span.today{background: #fb0;border:2px #fb0 solid;color:#fff;}

三、最后是js了,相信熟悉jquery的都感觉很简单,不太熟悉的可以多看看jquery手册,挺简单的。

 $(function(){
var init = {
startYear: 1900, //年份列表开始年
endYear: 2050 //年份列表结束年
};
var fun = {
init: function(){
this.showYear();
this.timeBox();
this.dateBox();
},
showYear: function(){ //循环年列表
var startYear = init.startYear,
endYear = init.endYear,
yearHtml = '';
for(;startYear <= endYear; startYear++){
yearHtml += '<li value="'+startYear+'">'+startYear+'年</li>';
};
$('.select-year').html(yearHtml);
},
timeBox: function(){ //系统时间
(function(){
var date = new Date();
var h = date.getHours(),
m = date.getMinutes(),
s = date.getSeconds();
var time = h + ':' + m + ':' + s;
var time = fun.timeBu(time);
$('.time').html(time);
setTimeout(arguments.callee, 1000);
})();
},
timeBu: function(val){
var arr = val.split(':');
for(var i = 0; i < arr.length; i++){
if(arr[i] < 10){
arr[i] = '0' + arr[i];
}
};
return arr.join(':');
},
showDate: function(year, month){ //日历展示
//改变下拉
$('.year-text').text(year + '年').attr('value', year);
$('.month-text').text(month + '月').attr('value', month);
$('.select-list li').removeClass('selected');
//为当前已经默认的年份和有份标为选中
$('.select-list li').addClass(function(i){
var value = $(this).attr('value');
if(value == year || value == month){
return 'selected';
}
}); var setDate = new Date();
setDate.setFullYear(year); //设置年份
setDate.setMonth(month-1); //设置月份,因为系统的月份都是比真实的小1
setDate.setDate(1); //设置成当前月第一天 var num = setDate.getDay(); //得到本月第一天是星期几 setDate.setMonth(month); //设置成正确的真实月份
var lastDate = new Date(setDate.getTime() - 1000*60*60*24); //计算得到当前月最后一天的日期格式
var lastDay = lastDate.getDate(); //获取本月最后一天是几号 //利用得到的当前月总天数来循环出当前月日历
var html = '';
for(var i = 1; i <= lastDay; i++){
html += '<li><span>'+i+'</span></li>';
};
$('.table').html(html); var first = $('.table li:first'),
w = first.outerWidth();
first.css('marginLeft', w * num + 'px'); //根据得到的本月第一天是周几得出第一个li所在的位置,从而排列好整个日历 var nowDate = new Date(), //得到系统当前的真实时间
nowYear = nowDate.getFullYear(),
nowMonth = nowDate.getMonth() + 1,
today = nowDate.getDate(); //获取当前是几号
if(nowYear == year && nowMonth == month){ //验证当前展示中是否包含今天
$('.table li').eq(today-1).find('span').addClass('today'); //标出今天
} },
dateBox: function(){
var date = new Date(),
year = date.getFullYear(), //获取当前是哪一年
month = date.getMonth() + 1; //获取当前月 //初始化日历
fun.showDate(year, month); }
}
fun.init(); //运行
//下拉选择
$('.select-text').on('click', function(e){
e.stopPropagation();
var self = $(this);
self.toggleClass('current');
self.parent().siblings('.select').find('.select-list').hide();
self.prev().toggle();
//点击是的年份时则始终保持已经选中的年在第一位
if(self.hasClass('year')){
$('.select-year').scrollTop(0);
var top = $('.select-year .selected').position().top;
$('.select-year').scrollTop(top);
}
});
//下拉悬浮
$('.select-list li').on({
'mouseenter': function(){
$(this).addClass('on');
},
'mouseleave': function(){
$(this).removeClass('on');
}
});
$(document).on('click', function(){
$('.select-list').hide();
$('.select-text').removeClass('current');
});
//切换年,月
$('.select-list li').on('click', function(){
if($(this).hasClass('selected')){ //如果是已经选中的则不用在重新初始化日历
return;
};
var self = $(this),
text = self.text(),
value = self.attr('value');
self.addClass('selected').siblings().removeClass('selected');
self.parent().next().find('span').text(text).attr('value', value);
var year = $('.year-text').attr('value'),
month = $('.month-text').attr('value');
fun.showDate(year, month);
}); //返回今天
$('.select-today').on('click', function(){ fun.dateBox();
}); //日期选择
//日期悬浮时
$('body').on({
'mouseenter': function(){
$(this).addClass('on');
},
'mouseleave': function(){
$(this).removeClass('on');
}
}, '.table span');
//点击日期
$('body').on('click', '.table span', function(){
var year = $('.year-text').attr('value'),
month = $('.month-text').attr('value'),
day = $(this).text();
var date = year + '-' + month + '-' + day;
alert(date);
}); //前一个月
$('.select-prev').on('click', function(){
var year = parseInt($('.year-text').attr('value')),
month = parseInt($('.month-text').attr('value'));
if(month - 1 > 0){
month = month - 1;
}else{
month = 12;
year = year - 1;
if(year < init.startYear){
return;
}
};
fun.showDate(year, month);
});
//后一个月
$('.select-next').on('click', function(){
var year = parseInt($('.year-text').attr('value')),
month = parseInt($('.month-text').attr('value'));
if(month + 1 <= 12){
month = month + 1;
}else{
month = 1;
year = year + 1;
if(year > init.endYear){
return;
}
};
fun.showDate(year, month);
}) })

将html,css,js都复制下来,放入到自己建立的对应文件中,注意把html中的引入路径修改对,别忘记引入jquery哦,最后只要双击打开html页面即可查看了。

这是最终效果图

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAakAAAG6CAIAAAA9DC45AAAYZklEQVR4nO3cPbKjyLZA4Z6TBnIdIt5EmEMPgGE8C/tOoKKiouPiPa+9Ntps63o8A4FIyF8pk73RXl/IqD5HVWcrgSUJdPq3GQDs+U16AAAQQPsAWET7AFgUa9///C83bty43f5G+7hx42bx9mb7AOCmaB8Ai2gfAItoHwCLaB8Ai2gfAItoHwCLaB8Ai2gfAItoHwCLGrbv/0xiTe6F7XWWOLC/Rdv2vTvVXSUfct01YYVb/2us8BejfTXRvtZoX2t2HjLtq4n2tUb7WrPzkGlfTbSvNdrXmp2HTPtqon2t0b7W7Dxk2lcT7WuN9rVm5yHTvppoX2u0r7Xchzz2j8ejGyb3Cwf9GPrr09Cdv7/7Jzx/8/gDdndZ/rXEjzwSbt9u5v0yRh/MadGdb3j+zjR0BSvyiRu3L7Cqvh26eCerSGn7xj68HOuu3I+zs18H+fbt59/0/5DIRor/mz7ph7z7cZF/duwju8g0dF13eDzRvxC7w35lxj7/sUq2bxq615j7oUMPJrbo4ZW7Ln33bF90Vx57/64UO9hbUtq+eRq6daFOJXou1DRNGTtjYMGnoXt0fZ+1J3+2w7/zkD1iJVsGdO8R2tHS/6T75fhUDj3veV8PIfVgPA8vsnLJJ8X1R0WfkvP2pVu278m/0+S2r8LiZdHavvm1JNGj+L32bdsmK2sK2ue+SHVfjK3jOYd5ZD9zXvqcH9dxjPz4KWxf8sGcH114dzutV867k7cP3qrHUnoXvqZ9mUX7ePGyxB5y+THf5Lkqs32nlV3+0vlvuxsm49CWb9/hW8f3dOeXOK9Xgvu1mM/tO+9VxyP8hu17Pcjkg/F+IbRyx2WIv1nzHuoVz5Xkrck6RWoHVvS67/m1TxYvS+IhP0fI/aGt2hd+CnA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r8+oW/I+bjjfbybNQrfcpXjw4/1fdS+1Eoevy+ywdNDxn5/4hpj75QteF4r/MsoVelqX/CUXuA5VKR9OUO6H3IRe7ObXMn93T59nfJGiZYXdGf797+1rnK8276slTzcSeC3LMv2SRX/swX/GDV3yThd7cONVWlT6xuwon2oRLxrtA8laB8qEe8a7UMJ2odKxLtG+1CC9qES8a7RPpSgfahEvGu0DyVoHyoR7xrtQwnah0rEu0b7UIL2oRLxrtE+lKB9qES8a7QPJWgfKhHvGu1DCdqHSsS7RvtQgvahEvGu0T6UoH2oRLxrtA8laB8qEe8a7UMJ2odKxLtG+1CC9qES8a7RPpSgfahEvGu0DyVoHyoR7xrtQwnah0rEu0b7UKJh+378/MWNGzduUjex9gGAWrQPgEW0D4BFtA+ARbQPgEW0D4BFtA+ARbQPgEW0D4BFtA+ARbQPgEW0D4BFtA+ARbQPgEW0D4BFtA+ARbQPgEW0D4BFtA+ARbQPgEW0D4BFGts39o+XfozcpRumVkMA+Grq2jf2u9xNQ3conNNF2gfgTeradzD2buLG/vla8PgNACigvX3T0PkTR/sAfEB7+7bXed5v0D4A71HdvuV0X+RqB+0D8B6F7VuKl7qWQfsAfEBh+3aWq7rewtE+AB/Q3b453DjaB+AD6tsXutpB+wB8gPYBsEh9+3jPC6ABZe0be6dn599p29+T9gF4l7L2zcff2D2+2XW/yy/2AniPvvYBQHu0D4BFtA+ARbQPgEW0D4BFtA+ARbQPgEW0D4BFtA+ARbQPgEW0D4BFtA+ARbQPgEW0D4BFtA+ARbQPgEW0D4BFtA+ARbQPgEW0D4BFDdv34+cv/bd31w3AvfG6D4BFtA+ARbQPgEW0D4BFtA+ARbQPgEW0D4BFtA+ARbQPgEW0D4BFH7WPGzdu3G59o33cuHGzeCtuHwB8K9oHwCLaB8Ai2gfAItoHwKL/ByEYDqFU7hzyAAAAAElFTkSuQmCC" alt="" />

相信明白后你也可以写出自己需要的日历功能。