All pastes #543024 Raw Edit

scrollPos

public javascript v1 · immutable
·published 2007-06-06 00:13 UTC
rendered paste body
	gimme.prototype.getRoughPosition = function(_accountForScroll, n)	{		var useScroll = _accountForScroll === false ? 0 : 1;				var elem = this.entities[n || 0];		var xPos = 0, yPos = 0;		while (elem !== null)		{			xPos += elem.offsetLeft - (elem.scrollLeft * useScroll);			yPos += elem.offsetTop - (elem.scrollTop * useScroll);			elem = elem.offsetParent;						if (elem === document.body || elem === document.documentElement)			{				useScroll = 0;			}		}				if (_accountForScroll && typeof GImme.Screen !== 'undefined')		{			var scrollPos = Gimme.Screen.getScrollPosition();			xPos += scrollPos.x;			yPos += scrollPos.y;		}				return { x: xPos, y: yPos };	};