Home > Web Front-end > HTML Tutorial > HTML gets the position of the current tag on the page and displays other floating windows_html/css_WEB-ITnose

HTML gets the position of the current tag on the page and displays other floating windows_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:52:56
Original
1378 people have browsed it

//event--event object

//ele current label

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 a.offsetTop;
l = l a.offsetLeft;
}
var x = (parseInt(l) - 200) " px";
var y = (parseInt( t) - 200) "px"; //The position of the current label
$(ele).prev().prev().show();
$(ele).prev().prev() .css("top", y);
$(ele).prev().prev().css("left", x);
$(ele).prev().prev() .css("width", "210px");
}

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template