Return to Snippet

Revision: 17970
at September 18, 2009 06:36 by jodm


Initial Code
function findPosition(obj) {
	
		var curleft = curtop = 0;
			
		if (obj.offsetParent) {
			do {
				curleft += obj.offsetLeft;
				curtop += obj.offsetTop;
			} while (obj = obj.offsetParent);
		} 
	
		var arrPositions = new Array();
		arrPositions[0] = curleft; 	// LEFT
		arrPositions[1] = curtop;	// TOP
	
		return arrPositions;		
	}

Initial URL

                                

Initial Description

                                

Initial Title
Javascript getPosition

Initial Tags

                                

Initial Language
JavaScript