<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: A better process to find maximum z-index within a page</title>
	<atom:link href="http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page/feed" rel="self" type="application/rss+xml" />
	<link>http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page</link>
	<description>Coding! don&#039;t ask, we&#039;re too good at it</description>
	<lastBuildDate>Wed, 09 May 2012 18:28:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: invest liberty reserve</title>
		<link>http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page#comment-15807</link>
		<dc:creator>invest liberty reserve</dc:creator>
		<pubDate>Mon, 09 Jan 2012 02:12:51 +0000</pubDate>
		<guid isPermaLink="false">http://abcoder.com/?p=28#comment-15807</guid>
		<description>A better process to find maximum z-index within a page I was recommended this website by my cousin. I&#039;m not sure whether this post is written by him as nobody else know such detailed about my trouble. You&#039;re incredible! Thanks! your article about A better process to find maximum z-index within a page Best Regards Lawrence Lawrence</description>
		<content:encoded><![CDATA[<p>A better process to find maximum z-index within a page I was recommended this website by my cousin. I&#8217;m not sure whether this post is written by him as nobody else know such detailed about my trouble. You&#8217;re incredible! Thanks! your article about A better process to find maximum z-index within a page Best Regards Lawrence Lawrence</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fandm</title>
		<link>http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page#comment-15753</link>
		<dc:creator>fandm</dc:creator>
		<pubDate>Fri, 16 Dec 2011 13:57:01 +0000</pubDate>
		<guid isPermaLink="false">http://abcoder.com/?p=28#comment-15753</guid>
		<description>Thanks!</description>
		<content:encoded><![CDATA[<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: User</title>
		<link>http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page#comment-6871</link>
		<dc:creator>User</dc:creator>
		<pubDate>Fri, 19 Nov 2010 19:08:01 +0000</pubDate>
		<guid isPermaLink="false">http://abcoder.com/?p=28#comment-6871</guid>
		<description>Whoops. It killed my html. Try #2

&lt;div style=&quot;background:#00f; position:absolute; top:0; left:0; z-index:50&quot;&gt;Test&lt;/div&gt;
&lt;div&gt;&lt;div style=&quot;background:#f00; position:absolute; top:0; left:0; z-index:100&quot;&gt;Test 2&lt;/div&gt;&lt;/div&gt;</description>
		<content:encoded><![CDATA[<p>Whoops. It killed my html. Try #2</p>
<p>&lt;div style=&#8221;background:#00f; position:absolute; top:0; left:0; z-index:50&#8243;&gt;Test&lt;/div&gt;<br />
&lt;div&gt;&lt;div style=&#8221;background:#f00; position:absolute; top:0; left:0; z-index:100&#8243;&gt;Test 2&lt;/div&gt;&lt;/div&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: User</title>
		<link>http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page#comment-6870</link>
		<dc:creator>User</dc:creator>
		<pubDate>Fri, 19 Nov 2010 19:06:09 +0000</pubDate>
		<guid isPermaLink="false">http://abcoder.com/?p=28#comment-6870</guid>
		<description>I just want to note that this will not work in all cases. You need to scan the entire DOM to find the top z-index. Maybe if you control all of the HTML/CSS on the page, then you can make sure that absolute elements are directly under the body tag but if you don&#039;t (say you are showing a third party ad), then you will need to scan the whole DOM.

Test case:

Test
  Test 2
</description>
		<content:encoded><![CDATA[<p>I just want to note that this will not work in all cases. You need to scan the entire DOM to find the top z-index. Maybe if you control all of the HTML/CSS on the page, then you can make sure that absolute elements are directly under the body tag but if you don&#8217;t (say you are showing a third party ad), then you will need to scan the whole DOM.</p>
<p>Test case:</p>
<p>Test<br />
  Test 2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: username</title>
		<link>http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page#comment-6831</link>
		<dc:creator>username</dc:creator>
		<pubDate>Mon, 11 Oct 2010 18:29:46 +0000</pubDate>
		<guid isPermaLink="false">http://abcoder.com/?p=28#comment-6831</guid>
		<description>&lt;code&gt;
highestElement.css(&quot;zIndex&quot;, $(&quot;*&quot;).length + 1);
&lt;/code&gt;

-OR-

&lt;code&gt;
$(&quot;body &gt; *&quot;).each(function(el, i) {
   if($(el).css(&quot;position&quot;) != &quot;static&quot; &amp;&amp; $(el).css(&quot;z-index&quot;) &gt;= maxZ) {
     maxZ = $(el).css(&quot;z-index&quot;);
   }
});
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p><code><br />
highestElement.css("zIndex", $("*").length + 1);<br />
</code></p>
<p>-OR-</p>
<p><code><br />
$("body &gt; *").each(function(el, i) {<br />
   if($(el).css("position") != "static" &amp;&amp; $(el).css("z-index") &gt;= maxZ) {<br />
     maxZ = $(el).css("z-index");<br />
   }<br />
});<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maya Campbell</title>
		<link>http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page#comment-6651</link>
		<dc:creator>Maya Campbell</dc:creator>
		<pubDate>Wed, 28 Apr 2010 03:06:04 +0000</pubDate>
		<guid isPermaLink="false">http://abcoder.com/?p=28#comment-6651</guid>
		<description>I have been perusing a few of your posts and have enjoyed it. Keep it up</description>
		<content:encoded><![CDATA[<p>I have been perusing a few of your posts and have enjoyed it. Keep it up</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rahen</title>
		<link>http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page#comment-4554</link>
		<dc:creator>rahen</dc:creator>
		<pubDate>Fri, 29 Jan 2010 18:47:31 +0000</pubDate>
		<guid isPermaLink="false">http://abcoder.com/?p=28#comment-4554</guid>
		<description>I&#039;m so glad to know that my code helpd you :)</description>
		<content:encoded><![CDATA[<p>I&#8217;m so glad to know that my code helpd you <img src='http://abcoder.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: santiago</title>
		<link>http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page#comment-4372</link>
		<dc:creator>santiago</dc:creator>
		<pubDate>Sat, 23 Jan 2010 03:44:52 +0000</pubDate>
		<guid isPermaLink="false">http://abcoder.com/?p=28#comment-4372</guid>
		<description>thanks a lot for this, it&#039;s the only solution i found that works fine in every major browser</description>
		<content:encoded><![CDATA[<p>thanks a lot for this, it&#8217;s the only solution i found that works fine in every major browser</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chb908</title>
		<link>http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page#comment-1210</link>
		<dc:creator>chb908</dc:creator>
		<pubDate>Wed, 03 Jun 2009 00:06:24 +0000</pubDate>
		<guid isPermaLink="false">http://abcoder.com/?p=28#comment-1210</guid>
		<description>birthday gift</description>
		<content:encoded><![CDATA[<p>birthday gift</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: C Snover</title>
		<link>http://abcoder.com/javascript/a-better-process-to-find-maximum-z-index-within-a-page#comment-211</link>
		<dc:creator>C Snover</dc:creator>
		<pubDate>Fri, 24 Apr 2009 01:20:05 +0000</pubDate>
		<guid isPermaLink="false">http://abcoder.com/?p=28#comment-211</guid>
		<description>You should really be checking for &lt;code&gt;$(e).css(&#039;position&#039;) != &#039;static&#039;&lt;/code&gt; instead. All positioned elements receive an order on the stack. Ref: &lt;a href=&quot;http://www.w3.org/TR/CSS21/visuren.html#z-index&quot; rel=&quot;nofollow&quot;&gt;CSS 2.1 § 9.9.1&lt;/a&gt;.

Regards,</description>
		<content:encoded><![CDATA[<p>You should really be checking for <code>$(e).css('position') != 'static'</code> instead. All positioned elements receive an order on the stack. Ref: <a href="http://www.w3.org/TR/CSS21/visuren.html#z-index" rel="nofollow">CSS 2.1 § 9.9.1</a>.</p>
<p>Regards,</p>
]]></content:encoded>
	</item>
</channel>
</rss>

