How does jquery get the coordinate value of the page element yulutxt is the input box of the input classic quotes, feedBackMessage function see http://www.wesoho.com/article/asp/2765.htm
Copy codeThe Code is as follows: var p = $ ("# yulutxt ");
Var yuluoffset = p. offset ();
FeedBackMessage (msg, yuluoffset. left + p. width () + 10, yuluoffset. top, 5000 );
-------------------
1. Get the object (custom adjustment opens new window reference element)
Var obj = $ ("# oButton ");
The object obtained in the instance is the pop-up window button, so that the position of the created window will be adjusted based on the button, and the lower right corner of the button displayed in the new window will be displayed in the instance.
2. Obtain the position (offset () method) of the object element)
Var offset = obj. offset ();
Obtains the position of an object element, including the top and left of the element. The call method is offset. left and offset. top. The left and top positions of the current object are displayed.
3. Obtain the width () of the object element)
Var right = offset. left + obj. width ();
The instance obtains the position in the lower-right corner of the object and creates the left position of the new window.
4. Obtain the height () method of the object element)
Var down = offset. top + obj. height ();
The instance obtains the position at the bottom right corner of the object and creates the position at the top of the new window.