<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.8" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: JavaScript: получение абсолютных координат элемента</title>
	<link>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/</link>
	<description>Валяльня</description>
	<pubDate>Sun, 17 May 2026 03:56:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.8</generator>

	<item>
		<title>by: D_A_N</title>
		<link>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-84280</link>
		<pubDate>Wed, 15 Dec 2010 05:36:17 +0000</pubDate>
		<guid>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-84280</guid>
					<description>див: 

получение координат (включая IE):
var ex=0, ey=0;

function A(mEvent)
{		
   if (typeof(mEvent)=="undefined") mEvent = window.event;
   obj = (mEvent.srcElement)?mEvent.srcElement:mEvent.target;
   
   ex = (typeof(mEvent.offsetX)!="undefined")?mEvent.offsetX:mEvent.layerX;
   ey = (typeof(mEvent.offsetY)!="undefined")?mEvent.offsetY:mEvent.layerY;

    document.getElementById("vvv").innerHTML=" "+kart+": x= "+ex+" ; y= "+ey; 
                            };</description>
		<content:encoded><![CDATA[<p>див: </p>
<p>получение координат (включая IE):<br />
var ex=0, ey=0;</p>
<p>function A(mEvent)<br />
{<br />
   if (typeof(mEvent)==&#8221;undefined&#8221;) mEvent = window.event;<br />
   obj = (mEvent.srcElement)?mEvent.srcElement:mEvent.target;</p>
<p>   ex = (typeof(mEvent.offsetX)!=&#8221;undefined&#8221;)?mEvent.offsetX:mEvent.layerX;<br />
   ey = (typeof(mEvent.offsetY)!=&#8221;undefined&#8221;)?mEvent.offsetY:mEvent.layerY;</p>
<p>    document.getElementById(&#8221;vvv&#8221;).innerHTML=&#8221; &#8220;+kart+&#8221;: x= &#8220;+ex+&#8221; ; y= &#8220;+ey;<br />
                            };
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Truin</title>
		<link>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-80917</link>
		<pubDate>Wed, 07 Jul 2010 09:33:21 +0000</pubDate>
		<guid>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-80917</guid>
					<description>А на IE не работает скорее всего из-за скобок... попробуй</description>
		<content:encoded><![CDATA[<p>А на IE не работает скорее всего из-за скобок&#8230; попробуй
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Truin</title>
		<link>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-80916</link>
		<pubDate>Wed, 07 Jul 2010 09:33:20 +0000</pubDate>
		<guid>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-80916</guid>
					<description>А на IE не работает скорее всего из-за скобок... попробуй</description>
		<content:encoded><![CDATA[<p>А на IE не работает скорее всего из-за скобок&#8230; попробуй
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Truin</title>
		<link>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-80918</link>
		<pubDate>Wed, 07 Jul 2010 09:33:20 +0000</pubDate>
		<guid>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-80918</guid>
					<description>А на IE не работает скорее всего из-за скобок... попробуй</description>
		<content:encoded><![CDATA[<p>А на IE не работает скорее всего из-за скобок&#8230; попробуй
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Михаил</title>
		<link>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-73739</link>
		<pubDate>Fri, 06 Nov 2009 00:28:02 +0000</pubDate>
		<guid>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-73739</guid>
					<description>на IE не работает</description>
		<content:encoded><![CDATA[<p>на IE не работает
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: lemur</title>
		<link>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-34819</link>
		<pubDate>Thu, 29 May 2008 09:32:25 +0000</pubDate>
		<guid>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-34819</guid>
					<description>var getRect = (function(){
		if (document.getBoxObjectFor)
			return function(e){
				var b = document.getBoxObjectFor(e);
               // alert(b.x+" , "+b.x+b.width+" , "+b.y+" , "+b.y+b.height);
                return [b.x, b.x+b.width, b.y, b.y+b.height];
			}
		if (document.body.getBoundingClientRect)
			return function(e){
				var b = e.getBoundingClientRect(), s = getScroll();
                //alert(b.left+" , "+b.right+" , "+b.top+" , "+b.bottom);
                return [b.left+s[0], b.right+s[0], b.top+s[1], b.bottom+s[1]];
			}
		return function(e){
			var x=0, y=0, w=e.offsetWidth, h=e.offsetHeight, s = getScroll();
			for(; e!=null; e = e.offsetParent){
				x += e.offsetLeft;
				y += e.offsetTop;
			}
           // alert(x+" , "+y);
            return [x+s[0], x+w+s[0], y+window.screenTop+s[1], y+h+window.screenTop+s[1]];
		}
	})()</description>
		<content:encoded><![CDATA[<p>var getRect = (function(){<br />
		if (document.getBoxObjectFor)<br />
			return function(e){<br />
				var b = document.getBoxObjectFor(e);<br />
               // alert(b.x+&#8221; , &#8220;+b.x+b.width+&#8221; , &#8220;+b.y+&#8221; , &#8220;+b.y+b.height);<br />
                return [b.x, b.x+b.width, b.y, b.y+b.height];<br />
			}<br />
		if (document.body.getBoundingClientRect)<br />
			return function(e){<br />
				var b = e.getBoundingClientRect(), s = getScroll();<br />
                //alert(b.left+&#8221; , &#8220;+b.right+&#8221; , &#8220;+b.top+&#8221; , &#8220;+b.bottom);<br />
                return [b.left+s[0], b.right+s[0], b.top+s[1], b.bottom+s[1]];<br />
			}<br />
		return function(e){<br />
			var x=0, y=0, w=e.offsetWidth, h=e.offsetHeight, s = getScroll();<br />
			for(; e!=null; e = e.offsetParent){<br />
				x += e.offsetLeft;<br />
				y += e.offsetTop;<br />
			}<br />
           // alert(x+&#8221; , &#8220;+y);<br />
            return [x+s[0], x+w+s[0], y+window.screenTop+s[1], y+h+window.screenTop+s[1]];<br />
		}<br />
	})()
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Val Petruchek</title>
		<link>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-18771</link>
		<pubDate>Sun, 11 Nov 2007 14:31:41 +0000</pubDate>
		<guid>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-18771</guid>
					<description>Вся соль, как всегда, в определениях. Что значит "правильно" и "неправильно", по-вашему?</description>
		<content:encoded><![CDATA[<p>Вся соль, как всегда, в определениях. Что значит &#8220;правильно&#8221; и &#8220;неправильно&#8221;, по-вашему?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: dzone</title>
		<link>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-18319</link>
		<pubDate>Wed, 07 Nov 2007 15:00:09 +0000</pubDate>
		<guid>http://zliypes.com.ua/blog/2007/02/15/javascript-code-to-get-absolute-coordinates/#comment-18319</guid>
					<description>работает не правильно, если на одном из элементов прокручен скроллбар..</description>
		<content:encoded><![CDATA[<p>работает не правильно, если на одном из элементов прокручен скроллбар..
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
