Gir*_*ari 16 javascript jquery jquery-ui
我是jquery的新手.我想从Jquery中的datepicker中删除今天的按钮.怎么做?我正在使用Jquery ui 1.8.10.
问候,Girish
Gaj*_*ang 27
在您的css文件中使用此样式
button.ui-datepicker-current { display: none; }
Run Code Online (Sandbox Code Playgroud)
小智 15
我有这个:
$(".datepicker").datepicker({
dateFormat: "yy-mm-dd",
changeMonth: true,
changeYear: true,
yearRange: "c-150:c+30",
showButtonPanel:true,
closeText:'Clear',
beforeShow: function( input ) {
setTimeout(function () {
$(input).datepicker("widget").find(".ui-datepicker-current").hide();
var clearButton = $(input ).datepicker( "widget" ).find( ".ui-datepicker-close" );
clearButton.unbind("click").bind("click",function(){$.datepicker._clearDate( input );});
}, 1 );
}
}).attr("readonly", true);
Run Code Online (Sandbox Code Playgroud)
这条线:
$(input).datepicker("widget").find(".ui-datepicker-current").hide();
Run Code Online (Sandbox Code Playgroud)
隐藏今日按钮
Pee*_*ter 14
阅读docs.jquery.com了解更多信息
$(document).ready(function() {
$("#datepicker").datepicker({
"showButtonPanel": false
});
});Run Code Online (Sandbox Code Playgroud)
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css" type="text/css" media="all" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js" type="text/javascript"></script>
<input type="text" id="datepicker"/>Run Code Online (Sandbox Code Playgroud)
Dha*_*esh -2
您可以选择适当的日期格式
$( ".selector" ).datepicker({ dateFormat: 'yy-mm-dd' });
Run Code Online (Sandbox Code Playgroud)
如果您不想,可以从上面删除 dd 这可能对您有帮助!
| 归档时间: |
|
| 查看次数: |
34163 次 |
| 最近记录: |