當我將鼠標懸停在表格中的某一行上時,將顯示圖像,並且當鼠標懸停在圖像上時,會顯示一個工具提示。 當我將鼠標放在工具提示中的選項上(即test1,test2)時,放置鼠標光標的選項應該突出顯示或更改其背景顏色,以讓用戶知道他們即將點擊的工具提示中的哪個選項。 請找到小提琴http://jsfiddle.net/0w9yo8x6/65/更改鼠標懸停在工具提示上的背景顏色
下面是示例JavaScript代碼:
$(function() {
var rowData;
$(document).tooltip({
items: "img, [data-title]",
content: function() {
var element = $(this);
if (element.is("img"))
{
rowdata = element.attr("data-title");
$(document).off('click', '#test');
$(document).on('click', '#test', function() {
test();
});
}
return $(this).prop('title');
},
show: null,
close: function (event, ui) {
ui.tooltip.hover(
function() {
$(this).stop(true).fadeTo(1000, 1);
},
function() {
$(this).stop(true).fadeOut(200, function() {
$(this).remove();
})
});
},
position: {
my: "left",
at: "right"
}
});
});
$(function() {
$('.one').attr('title', $('.myTooltipTable').remove().html());
$(document).tooltip();
});