【发布时间】:2014-06-30 16:45:47
【问题描述】:
构建日历,当用户将鼠标悬停在一天上时,我希望显示一个工具提示,但如果用户点击这一天,我希望显示一个单独的工具提示。到目前为止,当我悬停时没有任何反应,但是当我单击它时它会起作用。
HTML:
echo "<span><a href='#' class='add_event_tooltip tooltip' title="\$list_day\">$list_day</a></span>";
jquery:
<script type="text/javascript"><!-- TOOL TIP -->
$('.tooltip').live('mouseover', function(event) {
$(this).qtip({
overwrite: true,
position: { viewport: $(window)},
style: {
classes: 'ui-tooltip-shadow ui-tooltip-rounded'
},
show: {
event: event.type,
ready: true
}
}, event);
})
</script>
<script language="javascript" type="text/javascript">
$('.add_event_tooltip').qtip({
content: {
ajax: {
url: 'test.html'
},
},
position: {
my: 'center', // ...at the center of the viewport
at: 'center',
target: $(window)
},
show: {
event: 'click', // Show it on click...
solo: true, // ...and hide all other tooltips...
modal: true // ...and make it modal
},
hide: false,
style: 'ui-tooltip-light ui-tooltip-rounded'
});
</script>
一个类是否有可能压倒另一个类?是这样,我怎样才能得到这个,以便两个工具提示可以相互工作,鼠标悬停时的 .tooltip 和点击时的 .add_event_tool 。
谢谢。
【问题讨论】: