How jquery obtains the coordinates of the page elements Yulutxt is the input box of the input classical quotations, feedbackmessage function See http://www.wesoho.com/article/asp/2765.htm
Copy Code code as follows:
var p = $ ("#yulutxt");
var yuluoffset = P.offset ();
Feedbackmessage (Msg,yuluoffset.left+p.width () +10,yuluoffset.top,5000);
-------------------
1, get the object (custom adjust to open a new Window reference element)
var obj = $ ("#oButton");
The object I get in the instance is the pop-up button, so the new window created will be adjusted by the position of the button, and the bottom right corner of the button will be displayed in the new window that is created in the instance.
2, get the position of the object element (offset () method)
var offset = Obj.offset ();
Gets the position of the object element, which is the top and left of the element, called the Offset.left and the Offset.top, which is the position of the current object at the right and the upper part.
3, gets the object element width (width () method)
var right = Offset.left+obj.width ();
In an instance, gets the position of the lower-right corner of the object and creates the left position of the new window.
4, get the height of the object element (height () method)
var down = Offset.top+obj.height ();
Instance is to get the position of the lower-right corner of the object, creating the top position of the new window