时间:2021-07-01 10:21:17 帮助过:81人阅读
//ele当前标签
function hover(event, ele) {
var t, l, a, b;
a = ele;
t = a.offsetTop;
l = a.offsetLeft;
while (a.tagName != "BODY") {
a = a.offsetParent;
t = t + a.offsetTop;
l = l + a.offsetLeft;
}
var x = (parseInt(l) - 200) + "px";
var y = (parseInt(t) - 200) + "px";//当前标签的位置
$(ele).prev().prev().show();
$(ele).prev().prev().css("top", y);
$(ele).prev().prev().css("left", x);
$(ele).prev().prev().css("width", "210px");
}