<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Gilbert Pellegrom</title>
	
	<link>http://www.gilbertpellegrom.co.uk</link>
	<description>Software Engineer and Web Developer</description>
	<lastBuildDate>Mon, 06 Jul 2009 21:30:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Gilbitron" type="application/rss+xml" /><feedburner:emailServiceId>Gilbitron</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Is Twitter Replacing RSS</title>
		<link>http://feedproxy.google.com/~r/Gilbitron/~3/nVBm_VhdBfM/</link>
		<comments>http://www.gilbertpellegrom.co.uk/is-twitter-replacing-rss/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 21:25:20 +0000</pubDate>
		<dc:creator>gilbitron</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.gilbertpellegrom.co.uk/?p=253</guid>
		<description><![CDATA[Here is a question I have been asking myself for a while: is twitter replacing RSS? The only reason I am asking this is because over the last year (basically since I signed up for twitter) I have noticed a gradual shift in my reading patterns from RSS Feeds to twitter. Twitter has certainly had [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.gilbertpellegrom.co.uk/wp-content/uploads/2009/07/twitter_vs_rss1.gif" alt="twitter_vs_rss" title="twitter_vs_rss" width="150" height="64" class="alignright size-full wp-image-262" />Here is a question I have been asking myself for a while: <em>is <a href="http://twitter.com/">twitter</a> replacing RSS</em>? The only reason I am asking this is because over the last year (basically since I signed up for twitter) I have noticed a gradual shift in my reading patterns from RSS Feeds to twitter. Twitter has certainly had a huge impact the web development/design niche and, after recently hitting the mainstream, I find that even my mum knows what twitter is. It&#8217;s fast becoming a household name. So is it really changing the way we find out about interesting articles on the web? And is it killing RSS?<br />
<span id="more-253"></span></p>
<h3>Things of the Past</h3>
<p>I remember &#8220;back in the day&#8221; when I used to open up my web browser on my personalized homepage at <a href="http://www.netvibes.com/">netvibes</a> and spend a good hour or so trolling through my 50ish RSS feeds that I had decided qualified my regular attention. Certainly this was, at the time, an amazingly powerful way to keep up with the fast paced web development/design world. I didn&#8217;t even have to visit any of the sites. I could just read the content of the posts in the Feed Reader and whenever I found a new RSS feed it was as simple as clicking &#8220;Add Feed&#8221; and paste the URL. However thing&#8217;s are not as they used to be. Here is quote that seems to reflect my own feelings:</p>
<blockquote><p><a href="http://twitter.com/howardowens">howardowens</a>: I just trimmed my RSS subs down from nearly 300 to 75. Just couldn&#8217;t keep up. And if it&#8217;s really worth reading, it will be in Twitter. </p></blockquote>
<p>And that&#8217;s just it. Twitter has become the new measuring rod of internet content.</p>
<h3>Living in the Future</h3>
<p>So what do I do now? Well I just let twitter tell me when something interesting appears. Simple. I only follow people/sites who I find interesting or contribute in areas that interest me. This way I only come across posts that other people have justified as &#8220;shareable&#8221; and, if I agree it is an amazing post, then I&#8217;ll retweet. And whenever I find a new site that I want to follow the first thing I do is look for a &#8220;follow me&#8221; link. And if they don&#8217;t have a twitter account <em>then</em> I have to settle for RSS. I don&#8217;t know if any else has the same thoughts but twitter now takes priority as the information aggregator.</p>
<h3>So RSS is Dead?</h3>
<p>Now I&#8217;m not trying to claim by any means that RSS is dead, or even dying. All I&#8217;m saying here is that I have noticed my own patterns changing. I still use my RSS Feed Reader, but I have far less feeds that I look at regularly. Instead I keep my finger on the pulse using twitter. Apps have been released recently, such as <a href="http://www.feedafever.com/">Fever</a>, which try to combine the RSS Reader with the social recommendations side of Twitter which I think is a really cool idea. But really I&#8217;m interest to see what other people are doing. <strong>Do you think Twitter is replacing RSS?</strong> Which method of keeping up with latest news do you prefer? Have you switched to Twitter or are you a hardcore RSS fan?</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gilbitron?a=nVBm_VhdBfM:tsF_VWDha6g:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gilbitron?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=nVBm_VhdBfM:tsF_VWDha6g:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=nVBm_VhdBfM:tsF_VWDha6g:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=nVBm_VhdBfM:tsF_VWDha6g:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=nVBm_VhdBfM:tsF_VWDha6g:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=nVBm_VhdBfM:tsF_VWDha6g:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=nVBm_VhdBfM:tsF_VWDha6g:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gilbitron/~4/nVBm_VhdBfM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gilbertpellegrom.co.uk/is-twitter-replacing-rss/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.gilbertpellegrom.co.uk/is-twitter-replacing-rss/</feedburner:origLink></item>
		<item>
		<title>Digging Into The Wordpress Config File</title>
		<link>http://feedproxy.google.com/~r/Gilbitron/~3/EjHW7XwJjeQ/</link>
		<comments>http://www.gilbertpellegrom.co.uk/digging-into-the-wordpress-config-file/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 12:51:32 +0000</pubDate>
		<dc:creator>gilbitron</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.gilbertpellegrom.co.uk/?p=247</guid>
		<description><![CDATA[Recently Chris Coyier and Jeff Starr launched a blog called Digging Into Wordpress which hosts some cool posts about Wordpress and is a partner site for a book they are about to launch with the same name. 
One of their latest posts WordPress Configuration Tricks points some some really quite smart tricks that can be [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.gilbertpellegrom.co.uk/wp-content/uploads/2009/06/digiw.png" alt="Digging Into Wordpress" title="Digging Into Wordpress" width="85" height="105" class="alignright size-full wp-image-250" />Recently <a href="http://diggingintowordpress.com/chris-coyier/">Chris Coyier</a> and <a href="http://diggingintowordpress.com/jeff-starr/">Jeff Starr</a> launched a blog called <a href="http://diggingintowordpress.com/">Digging Into Wordpress</a> which hosts some cool posts about Wordpress and is a partner site for a book they are about to launch with the same name. </p>
<p>One of their latest posts <a href="http://diggingintowordpress.com/2009/06/wordpress-configuration-tricks/">WordPress Configuration Tricks</a> points some some really quite smart tricks that can be achieved by editing the <code>wp_config.php</code> file. For example:</p>
<ul>
<li>Manually setting your Blog Address and Site Address</li>
<li>Custom User and Usermeta Tables</li>
<li>Moving Your wp-content directory</li>
<li>Dealing with Post Revisions</li>
<li>Specifying the Autosave Interval</li>
<li>Saving and Displaying Database Queries for Analysis</li>
</ul>
<p>There is some really nifty stuff in there. If this is your kind of thing I would highly recommend you <a href="http://diggingintowordpress.com/2009/06/wordpress-configuration-tricks/">go and check it out</a> and maybe let Chris and Jeff know how much you appreciate their work.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gilbitron?a=EjHW7XwJjeQ:mMKagAMFwq4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gilbitron?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=EjHW7XwJjeQ:mMKagAMFwq4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=EjHW7XwJjeQ:mMKagAMFwq4:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=EjHW7XwJjeQ:mMKagAMFwq4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=EjHW7XwJjeQ:mMKagAMFwq4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=EjHW7XwJjeQ:mMKagAMFwq4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=EjHW7XwJjeQ:mMKagAMFwq4:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gilbitron/~4/EjHW7XwJjeQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gilbertpellegrom.co.uk/digging-into-the-wordpress-config-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.gilbertpellegrom.co.uk/digging-into-the-wordpress-config-file/</feedburner:origLink></item>
		<item>
		<title>jQuery Spotlight Released</title>
		<link>http://feedproxy.google.com/~r/Gilbitron/~3/VmcsbLiojEo/</link>
		<comments>http://www.gilbertpellegrom.co.uk/jquery-spotlight-released/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 13:26:57 +0000</pubDate>
		<dc:creator>gilbitron</dc:creator>
				<category><![CDATA[My Projects]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.gilbertpellegrom.co.uk/?p=240</guid>
		<description><![CDATA[I&#8217;ve just released my latest plugin called jQuery Spotlight. I&#8217;m not going to say too much here other than go and check it out!

As always comments and suggestions are always welcome. Enjoy.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released my latest plugin called jQuery Spotlight. I&#8217;m not going to say too much here other than go and <a href="http://www.gilbertpellegrom.co.uk/projects/jquery-spotlight/">check it out</a>!</p>
<p><img src="http://www.gilbertpellegrom.co.uk/wp-content/uploads/2009/06/spotlight.png" alt="jQuery Spotlight" title="jQuery Spotlight" width="300" height="200" class="aligncenter size-full wp-image-227" /></p>
<p>As always comments and suggestions are always welcome. Enjoy.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gilbitron?a=VmcsbLiojEo:mwistC2pzSU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gilbitron?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=VmcsbLiojEo:mwistC2pzSU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=VmcsbLiojEo:mwistC2pzSU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=VmcsbLiojEo:mwistC2pzSU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=VmcsbLiojEo:mwistC2pzSU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=VmcsbLiojEo:mwistC2pzSU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=VmcsbLiojEo:mwistC2pzSU:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gilbitron/~4/VmcsbLiojEo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gilbertpellegrom.co.uk/jquery-spotlight-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.gilbertpellegrom.co.uk/jquery-spotlight-released/</feedburner:origLink></item>
		<item>
		<title>Introduction to jQuery Events</title>
		<link>http://feedproxy.google.com/~r/Gilbitron/~3/3EvZIPm5ODA/</link>
		<comments>http://www.gilbertpellegrom.co.uk/introduction-to-jquery-events/#comments</comments>
		<pubDate>Wed, 27 May 2009 14:53:49 +0000</pubDate>
		<dc:creator>gilbitron</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.gilbertpellegrom.co.uk/?p=178</guid>
		<description><![CDATA[In the web development world there has been one Javascript framework which has really made it&#8217;s mark over the last couple of years. I am of course talking about jQuery. Everyone is using it including Google, Wordpress, Drupal, Mozilla, Digg&#8230; and the list goes on. And there is good reason for this, mainly that it [...]]]></description>
			<content:encoded><![CDATA[<p>In the web development world there has been one Javascript framework which has really made it&#8217;s mark over the last couple of years. I am of course talking about <a href="http://jquery.com/">jQuery</a>. Everyone is using it including Google, Wordpress, Drupal, Mozilla, Digg&#8230; and the list goes on. And there is good reason for this, mainly that it is a very flexible, extendible and powerful framework for Javascript.</p>
<p><img src="http://www.gilbertpellegrom.co.uk/wp-content/uploads/2009/05/jqueryevents.png" alt="jQuery Events" title="jQuery Events" width="400" height="200" class="aligncenter size-full wp-image-181" /><center><a href="http://www.gilbertpellegrom.co.uk/tutorials/jQueryEvents/" target="_blank">View Demo</a> | <a href="http://www.gilbertpellegrom.co.uk/wp-content/plugins/download-monitor/download.php?id=2" title="jQuery Events">Download Source</a></center></p>
<p>One of the most useful parts of jQuery is it&#8217;s ability to attach events to objects within a web page. When these events are triggered you can then use a custom function to do pretty much whatever you want with the event. So I thought I would share with you an introduction to jQuery Events.<br />
<span id="more-178"></span></p>
<h3>So how do events work?</h3>
<p>Events work by binding a function that will be executed when that event is triggered. What triggers the event depends on what the event is (e.g. a <em>&#8220;click&#8221;</em> event will be triggered when you click something, funnily enough). Infact, if you have been using jQuery properly, you might have already been using events without even noticing it:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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: #006600; font-style: italic;">//Do your work here...</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The above code should always be used before you do anything with jQuery.You will see this code all the time when people are using jQuery. However what you might not know is this is that <em><a href="http://docs.jquery.com/Events/ready#fn">ready</a></em> is actually an event and the code you put inside of it is the function you are binding to the <em>ready</em> event.</p>
<h3>So what events are there?</h3>
<p>There is a wide range of events that are supported by jQuery. At the time of writing (v1.3) there are 20 event helpers:</p>
<ul>
<li id="blur">blur</li>
<li id="change">change</li>
<li id="click">click</li>
<li id="dblclick">dblclick</li>
<li id="error">error</li>
<li id="focus">focus</li>
<li id="keydown">keydown</li>
<li id="keypress">keypress</li>
<li id="keyup">keyup</li>
<li id="mousedown">mousedown</li>
<li id="mouseenter">mouseenter</li>
<li id="mouseleave">mouseleave</li>
<li id="mousemove">mousemove</li>
<li id="mouseout">mouseout</li>
<li id="mouseover">mouseover</li>
<li id="mouseup">mouseup</li>
<li id="resize">resize</li>
<li id="scroll">scroll</li>
<li id="select">select</li>
<li id="submit">submit</li>
</ul>
<p>As you can see this provides an array of possible events to attach to your elements. To see these events in action have <a href="http://www.gilbertpellegrom.co.uk/tutorials/jQueryEvents/" target="_blank">a look at the demo</a>.</p>
<h3>So how do I add events to my elements?</h3>
<p>This is the easy part. jQuery provides methods which help you handle your events with amazing simplicity. I won&#8217;t go through all of the different types of events handlers here however you can see the documentation for these on <a href="http://docs.jquery.com/Events">the jQuery website</a>. The only one we are going to look at here is the <strong><a href="http://docs.jquery.com/Events/bind#typedatafn">bind</a></strong> handler. It can be used like this:<br />
<strong>HTML</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span>&gt;</span>
p { background:yellow; font-weight:bold; cursor:pointer; padding:5px; }
p.over { background: #ccc; }
span { color:red; }
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Click or double click here.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span></pre></div></div>

<p><strong>Javascript</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;click&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> str <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;( &quot;</span> <span style="color: #339933;">+</span> e.<span style="color: #660066;">pageX</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;, &quot;</span> <span style="color: #339933;">+</span> e.<span style="color: #660066;">pageY</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; )&quot;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;span&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Click happened! &quot;</span> <span style="color: #339933;">+</span> str<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;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;dblclick&quot;</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: #3366CC;">&quot;span&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Double-click happened in &quot;</span> <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tagName</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;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;mouseenter mouseleave&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<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;">toggleClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;over&quot;</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></div></div>

<p>As you can see it is uber simple to add events to almost any DOM elements using jQuery&#8217;s selector and the bind function. And remember that events can be added to more than just &lt;p&gt; tags. <a href="http://www.gilbertpellegrom.co.uk/tutorials/jQueryEvents/" target="_blank">In the demo</a> we attach our events to inputs just as easily.</p>
<h3>Conclusion</h3>
<p>So there you have it. A simple introduction to events in jQuery. Remember to <a href="http://docs.jquery.com/Events">read up on the documentation</a> for all of the events to see what amazing possibilities can be achieved with some simple javascript code. And as always let me know what you think about jQuery events. You could even <strong>share some examples</strong> of sites that you have made that use jQuery events.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gilbitron?a=3EvZIPm5ODA:WCgU5WxUE4A:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gilbitron?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=3EvZIPm5ODA:WCgU5WxUE4A:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=3EvZIPm5ODA:WCgU5WxUE4A:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=3EvZIPm5ODA:WCgU5WxUE4A:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=3EvZIPm5ODA:WCgU5WxUE4A:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=3EvZIPm5ODA:WCgU5WxUE4A:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=3EvZIPm5ODA:WCgU5WxUE4A:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gilbitron/~4/3EvZIPm5ODA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gilbertpellegrom.co.uk/introduction-to-jquery-events/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.gilbertpellegrom.co.uk/introduction-to-jquery-events/</feedburner:origLink></item>
		<item>
		<title>jQuery Dropdown Search Panel</title>
		<link>http://feedproxy.google.com/~r/Gilbitron/~3/Y4WJwSg8Et8/</link>
		<comments>http://www.gilbertpellegrom.co.uk/jquery-dropdown-search-panel/#comments</comments>
		<pubDate>Mon, 11 May 2009 13:00:12 +0000</pubDate>
		<dc:creator>gilbitron</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.gilbertpellegrom.co.uk/?p=146</guid>
		<description><![CDATA[For one of my projects recently I was playing about with search boxes and came up with a cool drop down search panel. So I thought I would share with you how I made the panel using some jQuery and CSS sprites.

View Demo &#124;/center>

Preparation
Things you will need to make this search panel:

Download jQuery v1.3 so [...]]]></description>
			<content:encoded><![CDATA[<p>For one of my projects recently I was playing about with search boxes and came up with a cool drop down search panel. So I thought I would share with you how I made the panel using some jQuery and CSS sprites.</p>
<p><img src="http://www.gilbertpellegrom.co.uk/wp-content/uploads/2009/05/jquerysearch.png" alt="jQuery Dropdown Search Panel" title="jQuery Dropdown Search Panel" width="400" height="50" class="aligncenter size-full wp-image-156" /></p>
<p><center><a href="http://www.gilbertpellegrom.co.uk/tutorials/jQueryDropdownSearch/" target="_blank">View Demo</a> | <a href="http://www.gilbertpellegrom.co.uk/wp-content/plugins/download-monitor/download.php?id=1" title="jQuery Dropdown Search Panel">Download Source</a></center><br />
<span id="more-146"></span></p>
<h3>Preparation</h3>
<p>Things you will need to make this search panel:</p>
<ul>
<li>Download <a href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2.min.js&#038;downloadBtn=">jQuery v1.3</a> so we can animate things.</li>
<li>Images for the background of your search box and the toggle button.</li>
</ul>
<p>In this case we will be using a <a href="http://css-tricks.com/css-sprites/">CSS Sprite</a> for our toggle button. It is good practice to use CSS sprites when making buttons that use images as it helps improve your site performance.</p>
<h3>The HTML</h3>
<p>So lets get to it. The HTML here is pretty simple. The main thing to notice here is our <em>top-search</em> div which just has a link and a normal search form in it. This keeps things valid and accessible.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=UTF-8&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>jQuery Dropdown Search Panel<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;styles/style.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;scripts/jquery.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
//Javascript will go here...
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;wrapper&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;header&quot;</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;top-search&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;searchtoggle&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Want to search?&quot;</span>&gt;</span>Search<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;box&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Search...&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;s&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;s&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">button</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;btn&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Submit Search&quot;</span>&gt;</span>Search<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">button</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
                <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>jQuery Dropdown Search Panel<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<h3>The CSS</h3>
<p>The CSS here is pretty simple as well with a few exceptions.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#header</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">900px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#searchtoggle</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">../images/toggle.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">21px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">19px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span><span style="color: #933;">-9999px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#searchtoggle</span><span style="color: #6666ff;">.up</span> <span style="color: #00AA00;">&#123;</span> 
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">../images/toggle.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#top-search</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">60px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">325px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#top-search</span> form <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">../images/search_top.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">262px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#top-search</span> <span style="color: #6666ff;">.box</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">195px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#top-search</span> <span style="color: #6666ff;">.btn</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">35px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span><span style="color: #933;">-9999px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span><span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>So here we are applying our styles to our header and <em>top-search</em> div. Most of this is standard CSS but a few things to notice are:</p>
<ul>
<li>The #header div has position relative so we can absolute position our #searchtoggle link.</li>
<li>The searchtoggle link uses a CSS sprite. Notice how initially the background image is positioned &#8220;left top&#8221; (i.e. pointing down). We then set another class, #searchtoggle.up, to override this position to &#8220;right top&#8221; (i.e. pointing up). You will see how this works in the javascript later.</li>
<li>You will also notice the line &#8220;text-indent:-9999px;&#8221; in certain places. This is a trick to hide the default text when CSS is applied (e.g. when you are using a background image and don&#8217;t need text) but it will keep the page accessible for people have CSS turned off and screen readers.</li>
<li>The &#8220;#top-search form&#8221; has the display value of &#8220;none&#8221; so the search form is initially hidden.</li>
</ul>
<h3>The Javascript</h3>
<p>Finally we reach the part where it all gets pulled together and we harness the power of jQuery. This javascript can go in the HTML script tags we prepared earlier or, a better practice, is to put it in it&#8217;s own JS file and include it.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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;">'#searchtoggle'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</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;">'#top-search form'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideToggle</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">300</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: #3366CC;">'#searchtoggle'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggleClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'up'</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>
&nbsp;
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#top-search .box'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</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: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'Search...'</span><span style="color: #009900;">&#41;</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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</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;">&#40;</span><span style="color: #3366CC;">'#top-search .box'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">blur</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: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</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;">val</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Search...'</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></pre></div></div>

<p>This first part here is where we use jQuery&#8217;s default slideToggle function to slide the &#8220;#top-search form&#8221; up and down when we click the #searchtoggle link. We also use the callback functionality to toggle the CSS class <em>up</em> on the #searchtoggle link. As we mentioned above this is how we use CSS to switch which way the arrows are pointing.</p>
<p>The second part of the jQuery here is simply to clear and populate the search box with default text if it is empty. This part is not required.</p>
<h3>Conclusion</h3>
<p>So there we have our jQuery Dropdown Search Panel. Feel free to use this code wherever you want in your projects. I hope you can see how some relatively simple jQuery and CSS can produce some cool results and add that extra punch to your websites. If you have any comments or constructive criticisms please let me hear them in the comments below.</p>
<p><a href="http://www.gilbertpellegrom.co.uk/tutorials/jQueryDropdownSearch/" target="_blank">View Demo</a> | <a href="http://www.gilbertpellegrom.co.uk/wp-content/plugins/download-monitor/download.php?id=1" title="jQuery Dropdown Search Panel">Download Source</a></p>
<h3>Update</h3>
<p>14th May 2009 &#8211; I&#8217;ve updated the CSS and HTML code to fix the bug that seemed to be happening in Chrome and Safari when you toggled the search panel on subsequent occasions the search box would move to the right. </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gilbitron?a=Y4WJwSg8Et8:TmHtpTl6xgs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gilbitron?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=Y4WJwSg8Et8:TmHtpTl6xgs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=Y4WJwSg8Et8:TmHtpTl6xgs:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=Y4WJwSg8Et8:TmHtpTl6xgs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=Y4WJwSg8Et8:TmHtpTl6xgs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=Y4WJwSg8Et8:TmHtpTl6xgs:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=Y4WJwSg8Et8:TmHtpTl6xgs:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gilbitron/~4/Y4WJwSg8Et8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gilbertpellegrom.co.uk/jquery-dropdown-search-panel/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://www.gilbertpellegrom.co.uk/jquery-dropdown-search-panel/</feedburner:origLink></item>
		<item>
		<title>LoveIcon</title>
		<link>http://feedproxy.google.com/~r/Gilbitron/~3/_5MYmzWIw60/</link>
		<comments>http://www.gilbertpellegrom.co.uk/loveicon/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 09:12:48 +0000</pubDate>
		<dc:creator>gilbitron</dc:creator>
				<category><![CDATA[My Portfolio]]></category>

		<guid isPermaLink="false">http://www.gilbertpellegrom.co.uk/?p=142</guid>
		<description><![CDATA[
URL: love-icon.com/
Features: Icon inspiration gallery built on Wordpress using custom fields.
]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.gilbertpellegrom.co.uk/wp-content/uploads/2009/04/loveiconbig.png" alt="LoveIcon" title="LoveIcon" width="400" class="aligncenter size-medium wp-image-143" /></p>
<p><strong>URL</strong>: <a href="http://love-icon.com/">love-icon.com/</a><br />
<strong>Features</strong>: Icon inspiration gallery built on Wordpress using custom fields.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gilbitron?a=_5MYmzWIw60:rqVH2M3tnzc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gilbitron?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=_5MYmzWIw60:rqVH2M3tnzc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=_5MYmzWIw60:rqVH2M3tnzc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=_5MYmzWIw60:rqVH2M3tnzc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=_5MYmzWIw60:rqVH2M3tnzc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=_5MYmzWIw60:rqVH2M3tnzc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=_5MYmzWIw60:rqVH2M3tnzc:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gilbitron/~4/_5MYmzWIw60" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gilbertpellegrom.co.uk/loveicon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.gilbertpellegrom.co.uk/loveicon/</feedburner:origLink></item>
		<item>
		<title>LoveIcon Launch</title>
		<link>http://feedproxy.google.com/~r/Gilbitron/~3/h7chVMosCPs/</link>
		<comments>http://www.gilbertpellegrom.co.uk/loveicon-launch/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 09:07:42 +0000</pubDate>
		<dc:creator>gilbitron</dc:creator>
				<category><![CDATA[My Projects]]></category>

		<guid isPermaLink="false">http://www.gilbertpellegrom.co.uk/?p=136</guid>
		<description><![CDATA[Although I was sad to see ProgTuts go, I&#8217;m very excited about my new site LoveIcon.

LoveIcon is an icon inspiration gallery/resource site for anyone who has an interest in beautiful icons. Recently I was aware that there was loads of CSS galleries but I had only ever seen a few Icon galleries. So I decided [...]]]></description>
			<content:encoded><![CDATA[<p>Although I was <a href="http://www.gilbertpellegrom.co.uk/progtuts-for-sale/">sad to see ProgTuts go</a>, I&#8217;m very excited about my new site <a href="http://love-icon.com/">LoveIcon</a>.</p>
<p><img src="http://www.gilbertpellegrom.co.uk/wp-content/uploads/2009/04/loveicon-300x132.png" alt="LoveIcon" title="LoveIcon" width="300" height="132" class="aligncenter size-medium wp-image-137" /></p>
<p><a href="http://love-icon.com/">LoveIcon</a> is an icon inspiration gallery/resource site for anyone who has an interest in beautiful icons. Recently I was aware that there was loads of CSS galleries but I had only ever seen a few Icon galleries. So I decided to make <a href="http://love-icon.com/">LoveIcon</a>. I&#8217;m hoping the site will fill up with the worlds most amazing icon designs from the best designers around the world.</p>
<p>Why not head on over and <a href="http://love-icon.com/">check it out</a>, or help me out by <a href="http://love-icon.com/submit/">submitting an icon suggestion</a>. So remember, if you see any amazing icons head over to LoveIcon and tell the world about them.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gilbitron?a=h7chVMosCPs:QLN8O64q29k:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gilbitron?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=h7chVMosCPs:QLN8O64q29k:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=h7chVMosCPs:QLN8O64q29k:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=h7chVMosCPs:QLN8O64q29k:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=h7chVMosCPs:QLN8O64q29k:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=h7chVMosCPs:QLN8O64q29k:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=h7chVMosCPs:QLN8O64q29k:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gilbitron/~4/h7chVMosCPs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gilbertpellegrom.co.uk/loveicon-launch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.gilbertpellegrom.co.uk/loveicon-launch/</feedburner:origLink></item>
		<item>
		<title>Digg’s Multipart XMLHttpRequests</title>
		<link>http://feedproxy.google.com/~r/Gilbitron/~3/l3FeSEoHpqM/</link>
		<comments>http://www.gilbertpellegrom.co.uk/diggs-multipart-xmlhttprequests/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 08:06:24 +0000</pubDate>
		<dc:creator>gilbitron</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.gilbertpellegrom.co.uk/?p=131</guid>
		<description><![CDATA[The developers at Digg have come up with an interesting way to speed up load times of high performance websites. They have taken the idea that reducing the number of HTTP requests per page speeds up website performance, and come up with a technique called MXHR (Multipart XMLHttpRequests). MXHR works by bundling files, sending them [...]]]></description>
			<content:encoded><![CDATA[<p>The developers at <a href="http://digg.com/">Digg</a> have come up with an interesting way to speed up load times of high performance websites. They have taken the idea that reducing the number of HTTP requests per page speeds up website performance, and come up with a technique called MXHR (Multipart XMLHttpRequests). MXHR works by bundling files, sending them through a single request, then separating them for use once they head down the pipe.</p>
<p>They have written a an addition to their Digg User Interface library called <em>DUI.Stream</em> to implement it. Specifically, DUI.Stream opens and reads multipart HTTP responses piece-by-piece through an XHR, passing each chunk to a JavaScript handler as it loads. This will then allow developers to drastically improve the speed of uncached page loads by bundling most of their resources into a single HTTP request, with a single time-to-first-byte and no request throttling by the user agent.</p>
<p>There are two demo&#8217;s you can view at the moment (remembering this is still in alpha development). However the demo that handles images is particularly impressive. (IE doesn&#8217;t seem to play nice). <a href="http://demos.digg.com/stream/streamDemo.html" target="_blank">Demo1</a>, <a href="http://demos.digg.com/stream/imageDemo.html" target="_blank">Demo2</a>.</p>
<p>If you are interested you can find out more about MXHR and the DUI.Stream on <a href="http://blog.digg.com/?p=621">Digg&#8217;s blog post</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gilbitron?a=l3FeSEoHpqM:XjtW8SgmmCU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gilbitron?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=l3FeSEoHpqM:XjtW8SgmmCU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=l3FeSEoHpqM:XjtW8SgmmCU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=l3FeSEoHpqM:XjtW8SgmmCU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=l3FeSEoHpqM:XjtW8SgmmCU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=l3FeSEoHpqM:XjtW8SgmmCU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=l3FeSEoHpqM:XjtW8SgmmCU:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gilbitron/~4/l3FeSEoHpqM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gilbertpellegrom.co.uk/diggs-multipart-xmlhttprequests/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.gilbertpellegrom.co.uk/diggs-multipart-xmlhttprequests/</feedburner:origLink></item>
		<item>
		<title>PHP Month Number to Month Name the Easy Way</title>
		<link>http://feedproxy.google.com/~r/Gilbitron/~3/99PbPcxvzFY/</link>
		<comments>http://www.gilbertpellegrom.co.uk/php-month-number-to-month-name-the-easy-way/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 10:00:58 +0000</pubDate>
		<dc:creator>gilbitron</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.gilbertpellegrom.co.uk/?p=126</guid>
		<description><![CDATA[Here&#8217;s a quickie for you. Ever wanted to convert a month number to a month name in PHP but hated having to do a huge switch statement? Well here is your answer.

&#60;?php
$monthNum = 5; 
$monthName = date&#40;&#34;F&#34;, mktime&#40;0, 0, 0, $monthNum, 10&#41;&#41;; 
echo $monthName; //output: May
?&#62;

Enjoy.
]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quickie for you. Ever wanted to convert a month number to a month name in PHP but hated having to do a huge switch statement? Well here is your answer.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$monthNum</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$monthName</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;F&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">mktime</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$monthNum</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$monthName</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//output: May</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Enjoy.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gilbitron?a=99PbPcxvzFY:ODsxH-ljC28:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gilbitron?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=99PbPcxvzFY:ODsxH-ljC28:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=99PbPcxvzFY:ODsxH-ljC28:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=99PbPcxvzFY:ODsxH-ljC28:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=99PbPcxvzFY:ODsxH-ljC28:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=99PbPcxvzFY:ODsxH-ljC28:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=99PbPcxvzFY:ODsxH-ljC28:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gilbitron/~4/99PbPcxvzFY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gilbertpellegrom.co.uk/php-month-number-to-month-name-the-easy-way/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.gilbertpellegrom.co.uk/php-month-number-to-month-name-the-easy-way/</feedburner:origLink></item>
		<item>
		<title>ProgTuts For Sale</title>
		<link>http://feedproxy.google.com/~r/Gilbitron/~3/090TAH1AYa0/</link>
		<comments>http://www.gilbertpellegrom.co.uk/progtuts-for-sale/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 22:29:26 +0000</pubDate>
		<dc:creator>gilbitron</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.gilbertpellegrom.co.uk/?p=121</guid>
		<description><![CDATA[Today I have put one of my other blogs, progtuts.info, up for sale. It saddens and excites me at the same time. My reason for selling in the first place is basically that I just don&#8217;t have the time to keep writing amazing quality tutorials for the site (whilst working and trying to graduate at [...]]]></description>
			<content:encoded><![CDATA[<p>Today I have put one of my other blogs, <a href="http://progtuts.info/">progtuts.info</a>, up for sale. It saddens and excites me at the same time. My reason for selling in the first place is basically that I just don&#8217;t have the time to keep writing amazing quality tutorials for the site (whilst working and trying to graduate at the same time). I&#8217;m sad to see the site go but I&#8217;m also very excited that someone else now has the opportunity to really make the site what it deserves to be, and I think it has loads of potential. The fact the the visitor and subscriber counts haven&#8217;t really dropped much since the last post was written (in November 2008) stands testament to the potential of the site.</p>
<p><a href="http://marketplace.sitepoint.com/auctions/63141" style="border:0;"><img alt="ProgTuts - High Quality Programming Tutorial Blog for Sale" title="ProgTuts - High Quality Programming Tutorial Blog for Sale" src="http://marketplace.sitepoint.com/auctions/63141.png" /></a></p>
<p>So I&#8217;m selling the site on <a href="http://marketplace.sitepoint.com/auctions/63141">Sitepoint.com</a>. If you would consider aquiring the site then please go and <a href="http://marketplace.sitepoint.com/auctions/63141">check out the auction</a>, and if you know of anyone else that might be interested then please spread the word. It would be much appreciated.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gilbitron?a=090TAH1AYa0:cD0z7kyWmpk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gilbitron?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=090TAH1AYa0:cD0z7kyWmpk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=090TAH1AYa0:cD0z7kyWmpk:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=090TAH1AYa0:cD0z7kyWmpk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=090TAH1AYa0:cD0z7kyWmpk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Gilbitron?a=090TAH1AYa0:cD0z7kyWmpk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Gilbitron?i=090TAH1AYa0:cD0z7kyWmpk:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gilbitron/~4/090TAH1AYa0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gilbertpellegrom.co.uk/progtuts-for-sale/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.gilbertpellegrom.co.uk/progtuts-for-sale/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 2.633 seconds. --><!-- Cached page generated by WP-Super-Cache on 2009-07-12 04:57:07 -->
