jquery ui datepicker下一年和上一年 [英] jquery ui datepicker next and previous year
问题描述
在日历两边实现两个按钮是一个好办法?一个用于选择下个月,一个用于选择明年,在右侧相互显示,并对左侧的以前的按钮进行相同的操作。
$(function(){
$(#dp)。datepicker({changeYear:true}) ;
})
发现是将Leniel的答案与一些其他属性相结合,这里是我的日期元素的代码
jQuery(document)每个(function(){
jQuery(this).datepicker({dateFormat:'dd / mm / yy',changeMonth: true,stepMonths:12,showAnim:slideDown});
jQuery('#ui-datepicker-div .ui-helper-hidden-accessible')css(position,absolute! ;
jQuery('#ui-datepicker-div')。css('clip','auto');
});
希望这样可以帮助别人尽可能多!
PS其他的东西是这样的,适用于所有浏览器(ie6 +,ff3 +,chrome4 +,safari,opera)
On the standard jquery.ui.datepicker widget there's only a next and previous button for selecting a month. If I enable year, it will be displayed in a select box.
What would be a good way to implement two buttons on both sides of the calendar? One for selecting next month and one for selecting next year, displayed next to each other on the right side, and do the same for the previous buttons on the left side of course.
$(function() {
$("#dp").datepicker({changeYear: true});
})
The best solution I have found is to combine Leniel's answer with some other properties, here is the code I have for my date elements
jQuery(document).ready(function(){
jQuery('input.date').each(function(){
jQuery(this).datepicker({dateFormat:'dd/mm/yy', changeMonth: true, stepMonths: 12, showAnim:"slideDown" });
jQuery('#ui-datepicker-div .ui-helper-hidden-accessible').css("position", "absolute !important");
jQuery('#ui-datepicker-div').css('clip', 'auto');
});
Hope this helps someone else as much as it did me!
P.S. The other stuff is so that the datepicker works in all browsers (ie6+,ff3+,chrome4+,safari,opera)
这篇关于jquery ui datepicker下一年和上一年的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!