我正在尝试在鼠标悬停时添加工具提示,工具提示应显示在鼠标指针的底部。当我悬停在日期上但无法绑定(bind)工具提示时,它会发出警报。 这是我的 fiddle link
JS代码
<script type="text/javascript">
$('#academic_calendar').datepicker({
minDate:0,
});
$(".ui-state-default").live("mouseenter", function() {
console.log("Hover");
});
</script>
最佳答案
jQuery live 已弃用。您需要使用 .on 或 .bind 处理程序。我更新了 fiddle与工具提示。
<script type="text/javascript">
$('#academic_calendar').datepicker({
minDate:0,
});
$(".ui-state-default").on("mouseenter", function() {
$(this).attr('title', 'This is the hover-over text'); // title attribute will be shown during the hover
});
</script>
关于javascript - Jquery UI.Datepicker : Display tooltip on mouse hover,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21753016/