我不想隱瞞我的提示,當鼠標在tooltip.but它應隱藏我們的鼠標了從工具提示。請幫我做這件事避免提示在鼠標懸停時
$(document).ready(function(){
$('[rel=tooltip]').bind('mouseover', function() {
if ($(this).hasClass('ajax')) {
var ajax = $(this).attr('ajax');
$.get(ajax, function(theMessage) {
$('<div class="tooltip">' + theMessage + '</div>').appendTo('body').fadeIn('fast');
});
}
else {
var theMessage = $(this).attr('content');
$('<div class="tooltip">' + theMessage + '</div>').appendTo('body').fadeIn('fast');
}
$(this).bind('mousemove', function(e) {
$('div.tooltip').css({
'top': e.pageY - ($('div.tooltip').height()/2) - 5,
'left': e.pageX + 15
});
});
}).bind('mouseout', function() {
$('div.tooltip').fadeOut('slow', function() {
$(this).remove();
});
});
});
通訊(修剪) HTML,格式化垂直這裏更清楚地顯示屬性:
<a href="#"
alt="Image"
tooltip=""
rel="tooltip"
content="<div id=imagcon><img src=img/1.jpg class=tooltip-image/></div>"
>View Sonic</a>
Ummmmmmmm再說一遍? –
你能提供相關的HTML嗎? – mc10
View Sonic – dvirus