我想使用 KendoUI 工具提示和日历,目前我可以单独设置它们。
<script>
$(document).ready(function() {
var today = new Date(),
events = [
+new Date(today.getFullYear(), today.getMonth(), 8),
+new Date(today.getFullYear(), today.getMonth(), 12),
+new Date(today.getFullYear(), today.getMonth(), 24),
+new Date(today.getFullYear(), today.getMonth() + 1, 6),
+new Date(today.getFullYear(), today.getMonth() + 1, 7),
+new Date(today.getFullYear(), today.getMonth() + 1, 25),
+new Date(today.getFullYear(), today.getMonth() + 1, 27),
+new Date(today.getFullYear(), today.getMonth() - 1, 3),
+new Date(today.getFullYear(), today.getMonth() - 1, 5),
+new Date(today.getFullYear(), today.getMonth() - 2, 22),
+new Date(today.getFullYear(), today.getMonth() - 2, 27)
];
// create Calendar from div HTML element
$("#calendar").kendoCalendar({
value: today,
dates: events,
month: {
// template for dates in month view
content: '# if ($.inArray(+data.date, data.dates) != -1) { #' +
'<div class="' +
'# if (data.value < 10) { #' +
"autohide-false" +
'# } else if ( data.value < 20 ) { #' +
"party" +
'# } else { #' +
"cocktail" +
'# } #' +
'">#= data.value #</div>' +
'# } else { #' +
'#= data.value #' +
'# } #'
},
footer: false
});
//set up tooltip
$(".autohide-false").kendoTooltip({
autoHide: false,
position: "top",
content: 'Hello there!'
});
});
</script>
HTML
<div id="calendar">
</div>
目前,当我单击日历小部件中的某一天时,工具提示似乎没有出现。任何想法为什么?感谢您花时间阅读本文。