我需要知道如何从jquery ui datepicker中删除title,tooltip,tooltipenable属性,以便在单击datepicker上的next和previous时它也不会显示为工具提示。以下是代码
$("#startDate").datepicker(
{ beforeShowDay: function(date) {
var day = date.getDay();
var date1 = date.getDate();
var today = new Date();
var difference = date - today;
var daysDifference = Math.round(difference/(1000*60*60*24));
if(daysDifference < 0) {
return [false]
}else{
return [true]
}
}
});
$( "#startDate").datepicker( "option", "dateFormat", "yy/mm/dd" );
$( "#startDate" ).datepicker({ minDate: '+0m +0w +1d'});
我试过这个但没用:
$(".ui-datepicker-next ui-corner-all").removeAttr("title");
$(".ui-datepicker-prev ui-corner-all").removeAttr("title");
in html
<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_1430805360315.datepicker._adjustDate('#startDate', +1, 'M');" tooltip="Next" tooltipenable="true">
<span class="ui-icon ui-icon-circle-triangle-e">Next</span>
</a>
如何删除它们。感谢
答案 0 :(得分:2)
如果您只需要隐藏工具提示,那么您可以在prevText
,nextText
选项中添加空文字,在默认工具提示中显示空标题,请尝试使用此代码
$(function() {
$("#startDate").datepicker({
beforeShowDay: function(date) {
var day = date.getDay();
var date1 = date.getDate();
var today = new Date();
var difference = date - today;
var daysDifference = Math.round(difference / (1000 * 60 * 60 * 24));
if (daysDifference < 0) {
return [false]
} else {
return [true]
}
}
});
$("#startDate").datepicker("option", "dateFormat", "yy/mm/dd");
$("#startDate").datepicker({
minDate: '+0m +0w +1d'
});
$("#startDate").datepicker("option", "prevText", "");
$("#startDate").datepicker("option", "nextText", "");
})
&#13;
<link href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<input type="text" id="startDate">
&#13;