我有一個在我的網站上的鏈接列表,當用戶點擊一個然後我顯示一個進一步的選項toolip,鏈接顯示爲90x60圖像,我想要的工具提示顯示將自己錨定到已被點擊的鏈接/圖像的左上角如何實現這一點,下面是我目前的實現。jquery將內容錨定到某個點
$('#wrapper #content ul li a').click(function(e) {
e.preventDefault();
$('#tooltip').remove();
var url = $(this).attr('href');
$.ajax({
type: "POST",
url: url,
data: "",
success: function(html){
var popup = html;
$('#content').append(popup);
$('#tooltip').css({
position: "absolute",
top: e.pageY - 200,
left: e.pageX - 10
});
}
});
});
任何幫助將不勝感激。