Based on the coordinates set the absolute position of the control (overlay) to display it accordingly. The overlay can be started any side/corner of the element.
Get the element object using JQuery:
var obj = $('[id$=controlelement]');Get the position of the element from Left
function findPosLeft(obj) { var pos = obj.offset(); var left = pos.left; return left; }Get the position of the element from Top
function findPosTop(obj) { var pos = obj.offset(); var top = pos.top; return top; }Get the position of the element from Bottom
function findPosBottom(obj) { var pos = obj.offset(); var top = pos.top; var height = obj.height(); var bottom = top + height; return bottom; }Get the position of the element from Right
function findPosRight(obj) { var pos = obj.offset(); var left = pos.left; var width = obj.width(); var right = left + width; return right; }
No comments:
Post a Comment