HTML获取当前标签在页面的位置,并且把其他的浮动窗口显示过来_html/css
来源:动视网
责编:小采
时间:2020-11-27 15:59:12
HTML获取当前标签在页面的位置,并且把其他的浮动窗口显示过来_html/css
HTML获取当前标签在页面的位置,并且把其他的浮动窗口显示过来_html/css_WEB-ITnose://event--事件对象 //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.off
导读HTML获取当前标签在页面的位置,并且把其他的浮动窗口显示过来_html/css_WEB-ITnose://event--事件对象 //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.off

//event--事件对象
//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");
}
HTML获取当前标签在页面的位置,并且把其他的浮动窗口显示过来_html/css
HTML获取当前标签在页面的位置,并且把其他的浮动窗口显示过来_html/css_WEB-ITnose://event--事件对象 //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.off