<?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>Alex's  Rocket &#187; thickbox</title>
	<atom:link href="http://klalex.com/tag/thickbox/feed/" rel="self" type="application/rss+xml" />
	<link>http://klalex.com</link>
	<description>Developing web applications, startups, technologies</description>
	<lastBuildDate>Tue, 21 Jun 2011 13:45:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Focus element in ThickBox</title>
		<link>http://klalex.com/2009/03/focus-element-in-thickbox/</link>
		<comments>http://klalex.com/2009/03/focus-element-in-thickbox/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 22:16:19 +0000</pubDate>
		<dc:creator>klalex</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[focus]]></category>
		<category><![CDATA[thickbox]]></category>

		<guid isPermaLink="false">http://klalex.com/?p=23</guid>
		<description><![CDATA[I faced with a problem focusing element in thickbox popup. I open login form using thickbox and want to take a focus on the first element of the form. Though the following code does look to be working: $&#40;document&#41;.ready&#40;function&#40;&#41; &#123; &#160; &#160; $&#40;&#34;input[name='username']&#34;&#41;.focus&#40;&#41;; &#125;&#41;; But there is a little trick. If you make a small [...]]]></description>
			<content:encoded><![CDATA[<p>I faced with a problem focusing element in thickbox popup. I open login form using thickbox and want to take a focus on the first element of the form. Though the following code does look to be working:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">$<span class="br0">&#40;</span>document<span class="br0">&#41;</span>.<span class="me1">ready</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&quot;input[name='username']&quot;</span><span class="br0">&#41;</span>.<span class="kw3">focus</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>But there is a little trick. If you make a small 100ms delay in focus() call it works:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">$<span class="br0">&#40;</span>document<span class="br0">&#41;</span>.<span class="me1">ready</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; setTimeout<span class="br0">&#40;</span><span class="st0">&quot;$(<span class="es0">\&quot;</span>input[name='username']<span class="es0">\&quot;</span>).focus();&quot;</span><span class="sy0">,</span> 100<span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://klalex.com/2009/03/focus-element-in-thickbox/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

