<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vance Lucas &#187; jQuery</title>
	<atom:link href="http://www.vancelucas.com/blog/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vancelucas.com</link>
	<description>Web Entrepreneur and PHP5 Guru</description>
	<lastBuildDate>Wed, 07 Jul 2010 17:37:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>jQuery UI Datepicker with AJAX and LiveQuery</title>
		<link>http://www.vancelucas.com/blog/jquery-ui-datepicker-with-ajax-and-livequery/</link>
		<comments>http://www.vancelucas.com/blog/jquery-ui-datepicker-with-ajax-and-livequery/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 02:22:32 +0000</pubDate>
		<dc:creator>Vance Lucas</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery UI]]></category>
		<category><![CDATA[LiveQuery]]></category>

		<guid isPermaLink="false">http://www.vancelucas.com/?p=293</guid>
		<description><![CDATA[I&#8217;ve been a little aggravated lately trying to get jQuery UI Datepicker to work correctly on dynamically added fields for creating additional line items to invoices for InvoiceMore. It works great for fields already displayed on the page, but it tends to have major issues with dynamically added fields through AJAX or AHAH. Of course [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a little aggravated lately trying to get <a href="http://jqueryui.com/demos/datepicker/">jQuery UI Datepicker</a> to work correctly on dynamically added fields for creating additional line items to invoices for <a href="http://www.invoicemore.com">InvoiceMore</a>. It works great for fields already displayed on the page, but it tends to have major issues with dynamically added fields through <a href="http://microformats.org/blog/2005/12/18/ajax-vs-ahah/">AJAX or AHAH</a>. Of course it won&#8217;t work out of the box with elements added dynamically to the DOM, so we can use <a href="http://docs.jquery.com/Events/live">jQuery&#8217;s $.live() event</a> (new in 1.3 &#8211; you previously had to use <a href="http://docs.jquery.com/Plugins/livequery">liveQuery</a>) to make it work. The Datepicker works by binding to the focus() event by default, but as of jQuery 1.3.2, the &#8216;focus&#8217; event cannot be monitored by the &#8216;live&#8217; event function. So we&#8217;re stuck with a little work around:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input.calendarSelectDate'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">datepicker</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>showOn<span style="color: #339933;">:</span><span style="color: #3366CC;">'focus'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>You would think just a simple &#8220;$(this).datepicker()&#8221; call wrapped inside the live() event would work, but it doesn&#8217;t. Turns out that in order to get it working consistently, you have to add the &#8217;showOn: focus&#8217; config option as well as manually focusing on the element with the focus() event. Charming.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vancelucas.com/blog/jquery-ui-datepicker-with-ajax-and-livequery/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Fixing IE7 Z-Index Issues with jQuery</title>
		<link>http://www.vancelucas.com/blog/fixing-ie7-z-index-issues-with-jquery/</link>
		<comments>http://www.vancelucas.com/blog/fixing-ie7-z-index-issues-with-jquery/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 23:45:43 +0000</pubDate>
		<dc:creator>Vance Lucas</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.vancelucas.com/?p=21</guid>
		<description><![CDATA[For some reason, Internet Explorer 7 does some pretty funky things, and has several known bugs with it&#8217;s rendering engine that drive web developers like me crazy.  While most of the known bugs occur in relatively obscure situations and go largely unnoticed, there are a few that really stick out and cause web developers to [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason, Internet Explorer 7 does some pretty funky things, and has <a href="http://www.quirksmode.org/bugreports/archives/explorer_7/index.html">several known bugs</a> with it&#8217;s rendering engine that drive web developers like me crazy.  While most of the known bugs occur in relatively obscure situations and go largely unnoticed, there are a few that really stick out and cause web developers to waste many hours trying to fix them.  The way IE7 renders z-index stacking orders is one of them.</p>
<p>One way to fix many of the issues with IE7 is to dynamically reverse the default z-index stacking order of the elements on your page. This will ensure the elements higher in your HTML source will also have a higher z-index order on your page, solving most of the IE stacking issues.<span id="more-21"></span> If you&#8217;re using <a href="http://jquery.com">jQuery</a> (the best Javascript library there is), here&#8217;s the quick fix:</p>
<p><code></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> zIndexNumber <span style="color: #339933;">=</span> <span style="color: #CC0000;">1000</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'zIndex'</span><span style="color: #339933;">,</span> zIndexNumber<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		zIndexNumber <span style="color: #339933;">-=</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p></code></p>
<p>This code will start with a z-index of 1000, and decrement the z-index for each DIV element of the page by 10, giving the first DIV a z-index of 1000, the second, 990, the third 980, and so on. Notice that the selector will find all DIV elements with the code &#8220;$(&#8216;div&#8217;)&#8221;, using the same syntax as CSS selectors.  If your HTML code has different requirements, feel free to change the code or the selector to suit your needs by following jQuery&#8217;s <a href="http://docs.jquery.com/Selectors">documentation on selectors</a>.</p>
<h3>Update for MooTools (04/14/2009):</h3>
<p><a href="http://www.liamsmart.co.uk/">A generous commenter</a> has posted the code for fixing z-index issues with <a href="http://mootools.net/">MooTools</a> 1.2:</p>
<p><code></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>Browser.<span style="color: #660066;">Engine</span>.<span style="color: #660066;">trident</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> zIndexNumber <span style="color: #339933;">=</span> <span style="color: #CC0000;">1000</span><span style="color: #339933;">;</span>
	$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>el<span style="color: #339933;">,</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		el.<span style="color: #660066;">setStyle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'z-index'</span><span style="color: #339933;">,</span>zIndexNumber<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		zIndexNumber <span style="color: #339933;">-=</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.vancelucas.com/blog/fixing-ie7-z-index-issues-with-jquery/feed/</wfw:commentRss>
		<slash:comments>75</slash:comments>
		</item>
	</channel>
</rss>
