mrkeck Sharing the Love

1Dec/120

jQuery Full Position of Element on Page

var eleBounds=function(ele){
	ele=$(ele);
	var off=ele.offset();
	var bounds={};
	bounds.top=off.top;
	bounds.bottom=bounds.top+ele.height();
	bounds.left=off.left;
	bounds.right=bounds.left+ele.width();
	bounds.height=ele.height();
	bounds.width=ele.width();
	return bounds;
}

Works well with phantomJS clipRect, just have to get the function in the page and return back the object and set clipRect equal to it.

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.