每月都有不同漂亮背景的日历

每月都有不同漂亮背景的日历
下载次数:1 文件大小:299.88KB 所需积分:0 QQ联系购买积分:3331653644(1元=10积分)
$(document).ready(function(){
  
	$('#calendar').datepicker({
		inline: true,
		firstDay: 7,
		showOtherMonths: true,
		dayNamesMin: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
		onChangeMonthYear: changeBackground
	});
 
	function changeBackground(year, month, obj){
		var months = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
		
		months.forEach(function(value){
			$('.calendar_img').removeClass(value);
		});
		
		$('.calendar_img').addClass(months[month - 1]);
	}
  
	var month = $('.ui-datepicker-month').text().toLowerCase();
	$('.calendar_img').addClass(month);
  
})

 

0 条评论