javascript - Getting the co-ordinates of an element -
this question has answer here:
how co-ordinates of element after onclick event ? need place overlay below icon clicked.
is there such built in function provided javascript rather manually writing function ?
in yui, use getxy() function returns absolute page position of object in dom. source function in yui2 here: http://developer.yahoo.com/yui/docs/dom.js.html.
in jquery, looks use .offset() method of jquery object: http://api.jquery.com/offset/.
you can either use 1 of or @ implementation , see how work code own.
Comments
Post a Comment