<?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>DevGrow &#187; Tutorials</title> <atom:link href="http://devgrow.com/category/tutorials/feed/" rel="self" type="application/rss+xml" /><link>http://devgrow.com</link> <description>Tips on web development, web design and online marketing</description> <lastBuildDate>Tue, 07 Sep 2010 21:34:26 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>Quick Tip: Preventing Right-Click Context Menu with jQuery</title><link>http://devgrow.com/quick-tip-preventing-right-click-context-menu-with-jquery/</link> <comments>http://devgrow.com/quick-tip-preventing-right-click-context-menu-with-jquery/#comments</comments> <pubDate>Sat, 04 Sep 2010 19:33:32 +0000</pubDate> <dc:creator>Monji</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[quick tips]]></category> <category><![CDATA[tips]]></category><guid isPermaLink="false">http://devgrow.com/?p=1783</guid> <description><![CDATA[One of my clients recently asked for an image slideshow on his blog to showcase his photography. When I asked him how he wanted it to be, he was insistent on using a Flash slideshow over JavaScript. It turns out that although the Flash gallery was far less useful for him, as he couldn&#8217;t view [...]<ul><li><a href="http://devgrow.com/simple-threaded-comments-with-jcollapsible/" rel="bookmark">Simple Threaded Comments with jCollapsible (new jQuery Plugin)</a></li><li><a href="http://devgrow.com/quick-seo-tip-set-preferred-domain-in-google-webmaster-tools/" rel="bookmark">Quick SEO Tip: Set Preferred Domain in Google Webmaster Tools</a></li><li><a href="http://devgrow.com/iphone-style-switches/" rel="bookmark">iPhone Style Radio and Checkbox Switches using jQuery and CSS</a></li></ul> ]]></description> <content:encoded><![CDATA[<p><em></em>One of my clients recently asked for an image slideshow on his blog to showcase his photography.  When I asked him how he wanted it to be, he was insistent on using a Flash slideshow over JavaScript.  It turns out that although the Flash gallery was far less useful for him, as he couldn&#8217;t view it on the iPhone or iPad, he preferred it anyways because it prevented people from right-clicking on his images and saving them to their hard drives.<span id="more-1783"></span></p><p>I spent a good bit of time attempting to explain to him that while people couldn&#8217;t right-click, they could still easily rip the photos using the Print Screen button or using any screen capture tool.  My suggestion was to simply watermark the images, however he was insistent on having no context-menus show up on right-click.  Ultimately, I ended up using a bit of jQuery to disable all context-menus in any images on the site, which allowed him to use the more compatible JS slideshows:</p><div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;contextmenu&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: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></div></td></tr></tbody></table></div><p>That should do the trick!  While I still don&#8217;t think it&#8217;s the best solution, if you run into the need to disable context menus for any element, feel free to use the snippet above (replace the img with anything else).</p><h3>Edit: Compatibility and Demo</h3><p>Someone mentioned it doesn&#8217;t work in Firefox in the comments &#8211; I&#8217;ve tested the code in the latest beta build of Chrome, IE8, Firefox 3.6.8, Safari and Opera &#8211; it <strong>does</strong> work in all of these browsers, at least in my Windows 7 x64 build.</p><p>Feel free to view the source of the demo to see how the exact implementation.  Also, keep in mind that this is certainly not a fool-proof solution (not even a great one) at preventing image theft.  It&#8217;s useful in deterring the subset of people who are less tech-savvy and are likely to give up after being unable to right-click.</p><p><center><a href="http://devgrow.com/examples/nocontext.html" class="download-button">Live Example</a></center></p><h3>Edit 2: I am not suggesting this!</h3><p>A number of comments make the assumption that I am recommending this technique for preventing image theft.  Let me be clear: I am not endorsing this technique for that purpose.  There are many ways around it and I made that clear to my client.</p><p>Since my client, however, was insistent on specifically disabling right-click for images, the above is the method I used.  It was somewhat difficult finding this information online so I decided to share it with others here on my blog.  It is certainly not the best solution (not even a good one) for preventing image theft, in my opinion a watermark works much better for that.  It may be useful for you in some circumstances, so use the knowledge however you&#8217;d like.</p> <img src="http://devgrow.com/?ak_action=api_record_view&id=1783&type=feed" alt="" /><ul><li><a href="http://devgrow.com/simple-threaded-comments-with-jcollapsible/" rel="bookmark">Simple Threaded Comments with jCollapsible (new jQuery Plugin)</a></li><li><a href="http://devgrow.com/quick-seo-tip-set-preferred-domain-in-google-webmaster-tools/" rel="bookmark">Quick SEO Tip: Set Preferred Domain in Google Webmaster Tools</a></li><li><a href="http://devgrow.com/iphone-style-switches/" rel="bookmark">iPhone Style Radio and Checkbox Switches using jQuery and CSS</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://devgrow.com/quick-tip-preventing-right-click-context-menu-with-jquery/feed/</wfw:commentRss> <slash:comments>27</slash:comments> </item> <item><title>Creating the Perfect CSS3 Buttons</title><link>http://devgrow.com/perfect-css3-buttons/</link> <comments>http://devgrow.com/perfect-css3-buttons/#comments</comments> <pubDate>Thu, 05 Aug 2010 17:37:59 +0000</pubDate> <dc:creator>Monji</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[buttons]]></category> <category><![CDATA[css]]></category> <category><![CDATA[css buttons]]></category> <category><![CDATA[css3]]></category> <category><![CDATA[html]]></category><guid isPermaLink="false">http://devgrow.com/?p=1645</guid> <description><![CDATA[The sweet looking buttons in this tutorial are created using only HTML and CSS3 &#8211; no JavaScript or images required! The buttons are easy to make and are pretty extensible but don&#8217;t take my word for it, check out the demo instead: Download The zip file below contains the CSS and HTML to create all [...]<ul><li><a href="http://devgrow.com/super-simple-css-buttons/" rel="bookmark">Super Simple CSS Buttons</a></li><li><a href="http://devgrow.com/slick-animated-menus-using-only-css3/" rel="bookmark">Slick Animated Menus Using Only CSS3</a></li><li><a href="http://devgrow.com/realistic-buttons-in-photoshop/" rel="bookmark">How to Create Realistic Buttons in Photoshop</a></li></ul> ]]></description> <content:encoded><![CDATA[<p>The sweet looking buttons in this tutorial are created using only HTML and CSS3 &#8211; no JavaScript or images required!  The buttons are easy to make and are pretty extensible but don&#8217;t take my word for it, check out the demo instead:<span id="more-1645"></span></p><p><iframe width="600" height="170" src="http://devgrow.com/examples/css3buttons/embed.html" style="border:none;" frameborder="0" marginheight="0" marginwidth="0" style="margin: 30px 0 0;"></iframe></p><h2>Download</h2><p>The zip file below contains the CSS and HTML to create all of the elements in the above example, as well as the image file used.<br /><center><a href="http://devgrow.com/examples/css3buttons/css3buttons.zip" class="download-button">CSS3 Buttons (zip)</a><a href="http://devgrow.com/examples/css3buttons/" class="download-button" style="margin-left:20px;">More Examples</a></center></p><h2>The Code</h2><p>To achieve the shadow and lighting effects we&#8217;re going for, I&#8217;m using wrapping the actual link text in <code class="codecolorer html4strict geshi"><span class="html4strict"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;</span></span></code> tags.  Some might think this is tedious or extra work but in my opinion the results are worth the effort.  You could also just write 1 line of JQuery code to automatically add the <code class="codecolorer html4strict geshi"><span class="html4strict"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;</span></span></code> tags to your links, making life even easier.</p><h5>HTML</h5><div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'#'</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'button blue'</span>&gt;&lt;<a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;</span>Blue<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span></div></td></tr></tbody></table></div><p>The only things required are the button class and the span tag inside the anchor.  Change the color to whatever you set in the CSS or leave it blank to use the default color.</p><h5>CSS</h5><p>The CSS is a bit more intense &#8211; it makes use of several CSS3 properties including <a href="http://www.css3.info/preview/box-shadow/">box shadows</a>, <a href="http://www.css3.info/preview/text-shadow/">text shadows</a> and <a href="http://css-tricks.com/css3-gradients/">background gradients</a>:</p><div class="codecolorer-container css blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">/* Overall Button Style */</span><br /> <span style="color: #6666ff;">.button</span> <span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#777</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">2px</span> <span style="color: #933;">1px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">2px</span> <span style="color: #933;">1px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">2px</span> <span style="color: #933;">1px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <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><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">vertical-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">middle</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span> span <span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">255</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">255</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.25</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span> <span style="color: #933;">12px</span> <span style="color: #ff0000;">'Arial'</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">1px</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.25</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> &nbsp; &nbsp; <br /> <span style="color: #808080; font-style: italic;">/* Button States */</span><br /> <span style="color: #6666ff;">.button</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> -webkit-gradient<span style="color: #00AA00;">&#40;</span>linear<span style="color: #00AA00;">,</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;">left</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">,</span> color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span> color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">,</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> -moz-linear-gradient<span style="color: #00AA00;">&#40;</span><span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">,</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span><span style="color: #3333ff;">:active </span><span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; -moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; box-shadow<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> -webkit-gradient<span style="color: #00AA00;">&#40;</span>linear<span style="color: #00AA00;">,</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">,</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">,</span> color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span> color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">,</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.2</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> -moz-linear-gradient<span style="color: #00AA00;">&#40;</span><span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">,</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.2</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span><span style="color: #3333ff;">:active </span>span <span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-top-color</span><span style="color: #00AA00;">:</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.2</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> &nbsp; &nbsp; <br /> <span style="color: #808080; font-style: italic;">/* Colors and Sizes */</span><br /> <span style="color: #6666ff;">.button</span>.<span style="color: #000000; font-weight: bold;">black</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#252a2a</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span>.<span style="color: #000000; font-weight: bold;">blue</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#3792c6</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span>.<span style="color: #993333;">red</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#cc2222</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span>.<span style="color: #993333;">green</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#69a846</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span><span style="color: #6666ff;">.brown</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#b6761a</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span><span style="color: #6666ff;">.selected</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#569334</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span>.<span style="color: #993333;">large</span> span <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">16px</span><span style="color: #00AA00;">;</span> &nbsp;<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span> <span style="color: #933;">14px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span><span style="color: #6666ff;">.small</span> span <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">11px</span><span style="color: #00AA00;">;</span> &nbsp;<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">4px</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div><h2>Improving Compatibility</h2><p>While the buttons work perfectly in the latest versions of Chrome, Safari and Firefox, any other browser will have difficulty with the CSS3 gradient property, which means the hover and active states of the button are hard to tell apart.  To fix this, we can add a fallback background image that is shown only to browsers that don&#8217;t support the required CSS3 properties, like such:</p><div class="codecolorer-container css blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">/* Button States */</span><br /> <span style="color: #6666ff;">.button</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-image</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;">button.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* fallback image */</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> -webkit-gradient<span style="color: #00AA00;">&#40;</span>linear<span style="color: #00AA00;">,</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;">left</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">,</span> color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span> color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">,</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> -moz-linear-gradient<span style="color: #00AA00;">&#40;</span><span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">,</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span><span style="color: #3333ff;">:active </span><span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; -moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; box-shadow<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-image</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;">button.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* fallback image */</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> -webkit-gradient<span style="color: #00AA00;">&#40;</span>linear<span style="color: #00AA00;">,</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">,</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">,</span> color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span> color-stop<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">,</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.2</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> -moz-linear-gradient<span style="color: #00AA00;">&#40;</span><span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">,</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.2</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div><p>I&#8217;ve included the <strong>button.png</strong> gradient image in the downloadable zip file so feel free to use that if you&#8217;d like.</p><h2>Taking it Further</h2><p>I&#8217;ve seen the articles by <a href="http://www.zurb.com/">Zurb</a> on <a href="http://www.zurb.com/blog_uploads/0000/0617/buttons-03.html">CSS3 buttons</a>, however I thought I&#8217;d try taking a slightly different approach in mine.  I also like the way these behave on the active and hover states better than the Zurb examples.  While I like the way these buttons look in most browsers, they still look a little weird in IE, as the top-border renders as a solid white bar.  The next step will be to explore options that will allow it to degrade even more gracefully in older browsers, perhaps using another image overlay for the top border itself.</p><p>Feedback is a must so let me know what you think!  As always, <a href="http://twitter.com/ThinkDevGrow">follow me on Twitter</a> and <a href="http://feeds.feedburner.com/devgrow">subscribe to the RSS feed</a> for more posts like this!</p> <img src="http://devgrow.com/?ak_action=api_record_view&id=1645&type=feed" alt="" /><ul><li><a href="http://devgrow.com/super-simple-css-buttons/" rel="bookmark">Super Simple CSS Buttons</a></li><li><a href="http://devgrow.com/slick-animated-menus-using-only-css3/" rel="bookmark">Slick Animated Menus Using Only CSS3</a></li><li><a href="http://devgrow.com/realistic-buttons-in-photoshop/" rel="bookmark">How to Create Realistic Buttons in Photoshop</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://devgrow.com/perfect-css3-buttons/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>The Complete Guide to Creating Your First Website</title><link>http://devgrow.com/complete-guide-to-creating-your-first-website/</link> <comments>http://devgrow.com/complete-guide-to-creating-your-first-website/#comments</comments> <pubDate>Sun, 25 Jul 2010 02:45:15 +0000</pubDate> <dc:creator>Monji</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[beginners]]></category> <category><![CDATA[introduction]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[web development]]></category> <category><![CDATA[websites]]></category><guid isPermaLink="false">http://devgrow.com/?p=1546</guid> <description><![CDATA[So one thing is clear: you want/need your own website.  But how do you go about making one?  Where do you even start?  Whether it's for your business, personal blog or any obscure reason, understanding how the web works and establishing an online presence is crucial in today's high-tech world.<ul><li><a href="http://devgrow.com/perfect-css3-buttons/" rel="bookmark">Creating the Perfect CSS3 Buttons</a></li><li><a href="http://devgrow.com/best-bet-css-practices/" rel="bookmark">Best Bet CSS Practices</a></li><li><a href="http://devgrow.com/simple-php-honey-pot/" rel="bookmark">Quick and Simple PHP Honey Pot Spam Prevention</a></li></ul> ]]></description> <content:encoded><![CDATA[<p class="note">This article is aimed at the completely inexperienced, those who may have always wanted a website but do not yet understand what it takes to make one.</p><p>So one thing is clear: you want/need your own website.  But how do you go about making one?  Where do you even start?  Whether it&#8217;s for your business, personal blog or any obscure reason, understanding how the web works and establishing an online presence is crucial in today&#8217;s high-tech world.<span id="more-1546"></span></p><h2>Understanding the Web and How Websites Work</h2><p>According to Wikipedia, a website can be defined as a &#8220;collection of related web pages, images, videos or other digital assets that are addressed relative to a common Uniform Resource Locator (URL).&#8221;  Simply put, it&#8217;s a collection of internet-accessible files stored somewhere and identified by an URL/address.  Let&#8217;s take a look at some more definitions first:</p><ul><li><strong>HTML</strong> &#8211; HyperText Markup Language, the name of the syntax/code used to create web page files (usually ending in .html)</li><li><strong>Host</strong> &#8211; A host makes your files accessible on the web by storing your files on a server/computer and providing a persistent internet connection</li><li><strong>Web Server</strong> &#8211; The actual machine or piece of hardware where your files are stored (usually by your host)</li><li><strong>IP Address</strong> &#8211; The numerical address of your Web Server; All computers connected to the internet have an IP address, even yours</li><li><strong>Domain Name</strong> &#8211; The actual address of the website, ie www.mydomain.com</li><li><strong>Registrar</strong> &#8211; The company that has permission from <a href="http://www.icann.org/">ICANN</a> to sell domain names, like <a href="http://www.godaddy.com/">GoDaddy</a></li><li><strong>DNS</strong> &#8211; Domain Name Servers, used to connect a domain name to a host/server</li></ul><p>Now that we have a basic understand of the terms involved, let&#8217;s take a look at how they are connected.  A website is a collection of <strong>HTML</strong> files and digital assets (images, scripts, videos, etc.) stored on a <strong>web server</strong> (provided by a <strong>host</strong>) that makes it accessible by anyone via a persistent internet connection.  How do you find that website?  Using a <strong>domain name</strong>, which is the online address of your website.  The domain name is purchased from a domain <strong>registrar</strong> and before it can be used, it must point to the correct <strong>domain name servers</strong> that correctly directs traffic to your web server&#8217;s <strong>IP address</strong>.  It may sound a bit convoluted at first but thinking about it in simpler terms might help to better grasp the concept:<br /> <img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/internet-diagram.gif" alt="" title="Diagram of How Website&#039;s Work" width="600" height="250" class="aligncenter size-full wp-image-1552" /><br /> In the above diagram, the green arrow represents the request you make when you enter a URL into your browser and the blue arrow represents the response sent back.  What&#8217;s important to note is that many hosts offer all of these services, so from one server you can get hosting (web server access) for your files and complete domain name setup.</p><h5>Further Reading:</h5><ol><li><a href="http://en.wikipedia.org/wiki/Website">Wikipedia Article on Websites</a></li><li><a href="http://www.howstuffworks.com/web-page.htm">HowStuffWorks: How Web Pages Work</a></li><li><a href="http://www.quackit.com/how-websites-work/">How Websites Work by Quackit</a></li></ol><h2>Creating Your First Website</h2><p>Now that you have an understanding of how websites work, it&#8217;s time to create your first web page.  The below steps will take you through the entire process, from picking a domain name to uploading your files.</p><h5>1. Picking the Right Host</h5><p><a href="http://mediatemple.net/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/mt.gif" alt="" title="Media Temple" width="100" height="100" class="alignright size-full wp-image-1560" /></a>This can be a bit complicated depending on your needs but for nearly all starters, a simple shared hosting plan is enough to host a basic website.  I suggest <a href="http://mediatemple.net/webhosting/gs/">Media Temple&#8217;s Grid Service</a> to most of my clients and <a href="http://devgrow.com/hostgator">Host Gator</a> to those feeling a little cheaper.  Both providers have been around for a long time and are fairly consistent in their services.</p><h5>2. Getting a Domain Name</h5><p><a href="http://www.godaddy.com/"><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/godadddy.gif" alt="" title="GoDaddy" width="100" height="100" class="alignright size-full wp-image-1559" /></a>There are many providers that offer domain names for a variety of prices.  In reality, they are all resellers for ICANN and whoever sells the most can usually offer the cheapest prices.  Personally I use <a href="http://www.godaddy.com/">GoDaddy</a> because they are one of the cheapest (use CHRIS3 coupon during checkout for $7.95 domains) but their website feels a bit spammy.  Throughout the entire purchasing process, they&#8217;ll suggest purchasing a million of their other services (including hosting) but I would personally advise against those.</p><h5>3. Configuring Your DNS</h5><p><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/nameserver.gif" alt="" title="Configure DNS" width="100" height="100" class="alignright size-full wp-image-1561" />When you register for your domain name, you&#8217;re given the option to edit it&#8217;s DNS information.  If you skip this, you can find it (at least in GoDaddy) under Manage Domains by checking the relevant domain name and selecting Set Nameservers from the top menu.  Enter the addresses of the DNS servers your host provided when you signed up with them to let GoDaddy know where to send visitors when they enter your URL.</p><h5>4. Creating a Basic Web Page</h5><p>As I mentioned earlier, HTML provides the backbone for web pages.  In fact, you can right-click on any website and click View Source to see the HTML code that is powering the site.  While it may look daunting at first, HTML is not really that complex and can be learned within a few days with some patience.  On your desktop, create a blank file and call it <code class="codecolorer text geshi"><span class="text">index.html</span></code>, then enter the following HTML into it:</p><div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">html</span></a>&gt;</span><br /> <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;&lt;<a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">title</span></a>&gt;</span>My Website<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">title</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;</span><br /> <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span><br /> <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span>Hello World<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br /> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span><br /> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">html</span></a>&gt;</span></div></td></tr></tbody></table></div><p>The above code will produce this, a simple white page with the words &#8216;Hello Word&#8217; written on it.  HTML is all about tags that must be opened and closed.  Every page should have a <code class="codecolorer html4strict geshi"><span class="html4strict">head</span></code> section with a proper <code class="codecolorer html4strict geshi"><span class="html4strict">title</span></code>, this is the text that is visible in the title bar of your browser.  The <code class="codecolorer html4strict geshi"><span class="html4strict">body</span></code> section is where any content you want shown on the website itself should go &#8211; in this example we have a simple paragraph (<code class="codecolorer html4strict geshi"><span class="html4strict"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span></span></code>) with that contains the &#8216;Hello World&#8217; statement.  Also note that each tag must be closed properly and in the correct order.</p><h5>5. Upload and Sit Back</h5><p><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/upload.gif" alt="" title="Upload" width="100" height="100" class="alignright size-full wp-image-1562" />Now that you have your first web page ready, you need to get it online by uploading the file to your web server.  This is done using an FTP, or File Transfer Protocol, program like <a href="http://filezilla-project.org/">FileZilla</a> (OS-independent) or <a href="http://winscp.net/eng/index.php">WinSCP</a> (Windows only).  When you signed up for your host, you should have received an e-mail that contains an FTP address, usually <em>ftp.mydomain.com</em>, and some login credentials.  Start the FTP program, enter your credentials and transfer the <code class="codecolorer text geshi"><span class="text">index.html</span></code> file from your computer to the <em>public_html</em> folder (or sometimes www) on your web server.</p><h5>Congratulations! Your Website is Now Online</h5><p>If you have properly configured your host, purchased a domain name and set your DNS information, entering your URL into a browser should load up your Hello World page.</p><h2>Make it Better With Open Source Software</h2><p>The example above is too simple for any practical use and chances are, you want something that looks nice and has more functionality.  While I would definitely recommend learning as much about building websites as you can first, there are a few ways to get a nice website up very quickly and with limited knowledge.  Open source software makes this possible, there are literally hundreds of blogging platforms and content management systems that you can install to have a very complete website running in minutes.</p><p>Most of these scripts require the minimum of PHP and MySQL, both of are included in 99% of shared hosting services.  Create a database, upload the script and point your browser to the install file, the rest is taken care of automatically.  The best part is that open source software is completely free to use, so definitely check it out.</p><h5>A Few Open Source Options:</h5><ol><li><a href="http://wordpress.org/">WordPress Blogging Software</a></li><li><a href="http://www.phpbb.com/">phpBB Forum Software</a></li><li><a href="http://www.madebyfrog.com/">FrogCMS Content Management System</a></li></ol><h2>Conclusion</h2><p>This article is meant to be a very basic introduction into the very big world of web development.  It&#8217;s meant for my friends who have always expressed interest in creating a website but don&#8217;t have the time to invest in learning to make one.  Feedback is appreciated and comments are always welcome!</p><p>Also remember to <a href="http://feeds.feedburner.com/devgrow">subscribe to the RSS Feed</a> and follow <a href="http://twitter.com/ThinkDevGrow">@ThinkDevGrow</a> on Twitter!</p> <img src="http://devgrow.com/?ak_action=api_record_view&id=1546&type=feed" alt="" /><ul><li><a href="http://devgrow.com/perfect-css3-buttons/" rel="bookmark">Creating the Perfect CSS3 Buttons</a></li><li><a href="http://devgrow.com/best-bet-css-practices/" rel="bookmark">Best Bet CSS Practices</a></li><li><a href="http://devgrow.com/simple-php-honey-pot/" rel="bookmark">Quick and Simple PHP Honey Pot Spam Prevention</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://devgrow.com/complete-guide-to-creating-your-first-website/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>How to Create Realistic Buttons in Photoshop</title><link>http://devgrow.com/realistic-buttons-in-photoshop/</link> <comments>http://devgrow.com/realistic-buttons-in-photoshop/#comments</comments> <pubDate>Sun, 18 Jul 2010 00:22:07 +0000</pubDate> <dc:creator>Monji</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[adobe]]></category> <category><![CDATA[buttons]]></category> <category><![CDATA[design]]></category> <category><![CDATA[photoshop]]></category> <category><![CDATA[web design]]></category><guid isPermaLink="false">http://devgrow.com/?p=1426</guid> <description><![CDATA[This is the first of a series of tutorials aimed at teaching you how to create realistic interface elements that you can use on your websites or in mobile applications. The buttons created in this article are simple and easy to customize, changing the value of a single layer effect can change the color of [...]<ul><li><a href="http://devgrow.com/perfect-css3-buttons/" rel="bookmark">Creating the Perfect CSS3 Buttons</a></li><li><a href="http://devgrow.com/super-simple-css-buttons/" rel="bookmark">Super Simple CSS Buttons</a></li><li><a href="http://devgrow.com/iphone-style-switches/" rel="bookmark">iPhone Style Radio and Checkbox Switches using jQuery and CSS</a></li></ul> ]]></description> <content:encoded><![CDATA[<p><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/all-buttons.jpg" alt="" title="all-buttons" width="600" height="150" class="alignright size-full wp-image-1448" /><br /> This is the first of a series of tutorials aimed at teaching you how to create realistic interface elements that you can use on your websites or in mobile applications.  The buttons created in this article are simple and easy to customize, changing the value of a single layer effect can change the color of the entire button.<span id="more-1426"></span></p><h3><span>Step 1</span> Prepare the Canvas</h3><p>Create a new Photoshop document about 600px wide and 300px high, that should give us plenty of space to work in.  Fill the background with a light grey color (I used #eeeeee) and apply the Noise filter (Filter -> Noise -> Add Noise) with the following settings:<br /> <img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/noise.jpg" alt="" title="noise" width="600" height="150" class="aligncenter size-full wp-image-1444" /></p><h3><span>Step 2</span> Create the Base Shape</h3><p>Create a white rounded rectangle (hot key: U) with a radius of 3px and with Anti-alias turned on.  I made mine 150px by 40px but any size will do.  Make sure the button itself is white (<code class="codecolorer css geshi"><span class="css"><span style="color: #cc00cc;">#FFFFFF</span></span></code>) as that will help when it comes to applying effects in the next step.<br /> <img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/blank-button.jpg" alt="" title="blank-button" width="600" height="100" class="aligncenter size-full wp-image-1438" /></p><h3><span>Step 3</span> Apply Layer Effects</h3><p>This step is really where the button gets it&#8217;s 3D feel from.  We&#8217;ll be applying a number of layer effects:<br /> <img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/drop-shadoiw.jpg" alt="" title="drop-shadoiw" width="600" height="250" class="aligncenter size-full wp-image-1440" /><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/inner-glow.jpg" alt="" title="inner-glow" width="600" height="250" class="aligncenter size-full wp-image-1442" /><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/bevel-emboss.jpg" alt="" title="bevel-emboss" width="600" height="400" class="aligncenter size-full wp-image-1437" /><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/color-overlay.jpg" alt="" title="color-overlay" width="600" height="250" class="aligncenter size-full wp-image-1439" /><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/gradient-overlay.jpg" alt="" title="gradient-overlay" width="600" height="250" class="aligncenter size-full wp-image-1441" /><br /> To summarize, we are applying:</p><ol><li><strong>Drop Shadow</strong> &#8211; <code class="codecolorer css geshi"><span class="css"><span style="color: #cc00cc;">#000000</span></span></code>, Normal blend mode, 15% Opacity, Angle: 120, Distance: 2, Spread: 0, Size: 2</li><li><strong>Inner Shadow</strong> &#8211; <code class="codecolorer css geshi"><span class="css"><span style="color: #cc00cc;">#FFFFFF</span></span></code>, Multiply blend mode, 30% Opacity, Angle: 120, Distance: 2, Spread: 0, Size: 2</li><li><strong>Inner Glow</strong> &#8211; <code class="codecolorer css geshi"><span class="css"><span style="color: #cc00cc;">#000000</span></span></code>, Normal blend mode, 40% Opacity, Choke: 100%, Size: 1</li><li><strong>Bevel and Emboss</strong> &#8211; Style: Inner Bevel, Direction: Up, SIze: 2, Soften: 2, Angle: 120, Altitude: 30, Anti-aliased, Highlight Mode: Hard Mix, Highlight Color: <code class="codecolorer css geshi"><span class="css"><span style="color: #cc00cc;">#FFFFFF</span></span></code>, Highlight Opacity: 50%, Shadow Mode: Multiply, Shadow Color: <code class="codecolorer css geshi"><span class="css"><span style="color: #cc00cc;">#000000</span></span></code>, Shadow Opacity: 35%</li><li><strong>Color Overlay</strong> &#8211; Mode: Linear Burn, Color: <code class="codecolorer css geshi"><span class="css"><span style="color: #cc00cc;">#b6f27a</span></span></code> (you could use another light color instead)</li><li><strong>Gradient Overlay</strong> &#8211; Blend mode: Luminosity, Opacity: 25%, Gradient: Black to white (left to right)</li></ol><p>The above settings should produce a 3D-looking button effect.  Applying both gradient and color overlays allows us to easily change the color of the button &#8211; simply change the color overlay until you&#8217;re satisfied with the color of the button.</p><h3><span>Step 4</span> Add Text</h3><p>Depending on whether or not you chose a light or dark color overlay, your text will have to be either black or white.  For light backgrounds use black and for dark backgrounds, use black text color.  I used the <strong>Gotham Bold</strong> font with uppercase letters.  I cranked the layer fill opacity down to 75% and applied the <strong>Bevel and Emboss</strong> style with the following settings:<br /> <img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/letter-effects.jpg" alt="" title="letter-effects" width="600" height="450" class="aligncenter size-full wp-image-1443" /></p><h3><span>Step 5</span> Create Hover and Active States</h3><p>To create the hover state, I simply change the <strong>Color Overlay</strong> value to something a little lighter and punchier &#8211; in this case <code class="codecolorer css geshi"><span class="css"><span style="color: #cc00cc;">#ccff84</span></span></code>.  As for the active state, I change a few settings on both the text and the button itself.</p><h5>Active Button:</h5><p>The button itself has the gradient and bevel reversed, a different color overlay and a inner shadow among other things.  The exact values are:</p><ol><li><strong>Drop Shadow</strong> &#8211; <code class="codecolorer css geshi"><span class="css"><span style="color: #cc00cc;">#FFFFFF</span></span></code>, 50% Opacity, Distance: 2, Size: 2</li><li><strong>Inner Shadow</strong> &#8211; <code class="codecolorer css geshi"><span class="css"><span style="color: #cc00cc;">#000000</span></span></code>, 30% Opacity, Angle: -60, Distance: 2, Size: 2</li><li><strong>Inner Glow</strong> &#8211; Same as default and hover states</li><li><strong>Bevel and Emboss</strong> &#8211; Change Direction from Up to Down, Change Highlight Opacity to 25%</li><li><strong>Color Overlay</strong> &#8211; I set mine to <code class="codecolorer css geshi"><span class="css"><span style="color: #cc00cc;">#7ab91f</span></span></code></li><li><strong>Gradient Overlay</strong> &#8211; Reverse gradient and set to 45% Opacity</li></ol><p>Here are the same settings in Photoshop:<br /> <img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/active-drop-shadow.jpg" alt="" title="active-drop-shadow" width="600" height="350" class="aligncenter size-full wp-image-1432" /><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/active-inner-shadow.jpg" alt="" title="active-inner-shadow" width="600" height="350" class="aligncenter size-full wp-image-1435" /><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/active-inner-glow.jpg" alt="" title="active-inner-glow" width="600" height="400" class="aligncenter size-full wp-image-1434" /><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/active-bevel.jpg" alt="" title="active-bevel" width="600" height="400" class="aligncenter size-full wp-image-1430" /><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/active-color-overlay.jpg" alt="" title="active-color-overlay" width="600" height="300" class="alignright size-full wp-image-1431" /><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/active-gradient.jpg" alt="" title="active-gradient" width="600" height="300" class="alignright size-full wp-image-1433" /></p><h5>Active Text:</h5><p>For the text, I changed the color to white (<code class="codecolorer css geshi"><span class="css"><span style="color: #cc00cc;">#FFFFFF</span></span></code>) and lowered it&#8217;s fill opacity to 85%.  I also moved the actual text down by a pixel, which gives it the feeling of being pressed.  Lastly, I applied a Bevel and Emboss layer effect with the following settings:<br /> <img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/active-text.jpg" alt="" title="active-text" width="600" height="400" class="alignright size-full wp-image-1436" /></p><h3><span>Final Results</span></h3><p><img src="http://cdn.devgrow.com/wp-content/uploads/2010/07/all-buttons.jpg" alt="" title="all-buttons" width="600" height="150" class="alignright size-full wp-image-1448" /><br /> As you can see, I also made some darker colored buttons.  For the text on those, I used the same settings as the Active state of the lighter buttons, with the only difference being the Fill Opacity was turned up to 90% instead of 85%.</p><h3><span>Download</span></h3><p>The complete PSD is available under the <a href="http://creativecommons.org/licenses/by/3.0/us/">Creative Commons License</a>, feel free to download and share as you please:<br /><center><a href="http://devgrow.com/examples/buttons.zip" class="download-button">Download PSD (zip)</a></center></p><h3><span>Conclusion</span></h3><p>This is my first real Photoshop tutorial.  Were the screenshots helpful?  Did I cover everything needed to reproduce the desired effect?  As always, feedback is highly appreciated.</p><p>Also, <a href="http://feeds.feedburner.com/devgrow">subscribe to the RSS feed</a> and <a href="http://twitter.com/ThinkDevGrow">follow us on Twitter</a> if you&#8217;re not already, there&#8217;s going to be a giveaway soon you don&#8217;t want to miss!</p> <img src="http://devgrow.com/?ak_action=api_record_view&id=1426&type=feed" alt="" /><ul><li><a href="http://devgrow.com/perfect-css3-buttons/" rel="bookmark">Creating the Perfect CSS3 Buttons</a></li><li><a href="http://devgrow.com/super-simple-css-buttons/" rel="bookmark">Super Simple CSS Buttons</a></li><li><a href="http://devgrow.com/iphone-style-switches/" rel="bookmark">iPhone Style Radio and Checkbox Switches using jQuery and CSS</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://devgrow.com/realistic-buttons-in-photoshop/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Quick and Simple PHP Honey Pot Spam Prevention</title><link>http://devgrow.com/simple-php-honey-pot/</link> <comments>http://devgrow.com/simple-php-honey-pot/#comments</comments> <pubDate>Sat, 10 Jul 2010 22:20:11 +0000</pubDate> <dc:creator>Monji</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[contact form]]></category> <category><![CDATA[honey pot]]></category> <category><![CDATA[php]]></category> <category><![CDATA[programming]]></category><guid isPermaLink="false">http://devgrow.com/?p=1369</guid> <description><![CDATA[A honey pot trap involves creating a form with an extra field that is hidden to human visitors but readable by robots.  The robot fills out the invisible field and submits the form, leaving you to simply ignore their spammy submission or blacklist their IP.  It's a very simple concept that can be implemented in a few minutes and it just works - add them to your contact and submission forms to help reduce spam.<ul><li><a href="http://devgrow.com/simple-threaded-comments-with-jcollapsible/" rel="bookmark">Simple Threaded Comments with jCollapsible (new jQuery Plugin)</a></li><li><a href="http://devgrow.com/best-bet-css-practices/" rel="bookmark">Best Bet CSS Practices</a></li><li><a href="http://devgrow.com/complete-guide-to-creating-your-first-website/" rel="bookmark">The Complete Guide to Creating Your First Website</a></li></ul> ]]></description> <content:encoded><![CDATA[<p>This technique has been floating around the web for the past few weeks so it&#8217;s definitely worth sharing here.  Using standard HTML, CSS and a little PHP, you can filter out a lot of robots and spammers that crawl the web for unsuspecting forms.  Credit to <a href="http://www.aaronjamesyoung.com/">Aaron James Young</a> for reminding me about this technique (he posted a similar snippet on <a href="http://forrst.com/">Forrst</a>).</p><p>A honey pot trap involves creating a form with an extra field that is hidden to human visitors but readable by robots.  The robot fills out the invisible field and submits the form, leaving you to simply ignore their spammy submission or blacklist their IP.  It&#8217;s a very simple concept that can be implemented in a few minutes and it just works &#8211; add them to your contact and submission forms to help reduce spam.  I&#8217;ve used them extensively in my last few projects, I&#8217;ve found it to be well worth the small time investment.</p><h2>Contact Form Example</h2><p>Here is an example of a simple contact form that uses the honey pot spam prevention method:<br /><center><a href="http://devgrow.com/examples/honeypot/" class="download-button view">View Example</a><a href="http://devgrow.com/examples/honeypot/honeypot.zip" class="download-button" style="margin-left:20px;">Download Source</a></center></p><h3>The HTML:</h3><div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">form</span></a> <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><br /> &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/fieldset.html"><span style="color: #000000; font-weight: bold;">fieldset</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/legend.html"><span style="color: #000000; font-weight: bold;">legend</span></a>&gt;</span>Contact Me<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/legend.html"><span style="color: #000000; font-weight: bold;">legend</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span>Name:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span>E-mail:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span>Message:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/textarea.html"><span style="color: #000000; font-weight: bold;">textarea</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;message&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/textarea.html"><span style="color: #000000; font-weight: bold;">textarea</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- The following field is for robots only, invisible to humans: --&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;robotic&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;pot&quot;</span>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span>If you're human leave this blank:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;robotest&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;robotest&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;robotest&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Send Message&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br /> &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/fieldset.html"><span style="color: #000000; font-weight: bold;">fieldset</span></a>&gt;</span><br /> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">form</span></a>&gt;</span></div></td></tr></tbody></table></div><h3>The PHP:</h3><div class="codecolorer-container php blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br /> &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$to</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'your-email-here@gmail.com'</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Contact Form Submission'</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$from_name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$from_email</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'message'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$robotest</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'robotest'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$robotest</span><span style="color: #009900;">&#41;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;You are a gutless robot.&quot;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$from_name</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$from_email</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$header</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: <span style="color: #006699; font-weight: bold;">$from_name</span> &lt;<span style="color: #006699; font-weight: bold;">$from_email</span>&gt;&quot;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/mail"><span style="color: #990000;">mail</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #339933;">,</span> <span style="color: #000088;">$header</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$success</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;You are human and your message was sent!&quot;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;You are human but there was a problem sending the e-mail.&quot;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;All fields are required.&quot;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$error</span><span style="color: #009900;">&#41;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;msg error&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$error</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$success</span><span style="color: #009900;">&#41;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;msg success&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$success</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br /> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div><h3>The CSS:</h3><div class="codecolorer-container css blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #6666ff;">.robotic</span> <span style="color: #00AA00;">&#123;</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></div></td></tr></tbody></table></div><p>In the above example link, I added some optional CSS to make it look a little nicer.  Also, you&#8217;ll notice the actual e-mail form doesn&#8217;t work, as the to e-mail address is a fake one.  The contact form part is just to illustrate the honey pot, the important thing to notice is that the last text field is hidden using CSS (the entire paragraph) and that if text is entered in the field, the entire form fails.</p><h2>Conclusion</h2><p>This concept is certainly not my own and in fact, there is even an entire project dedicated to catching spammers using dummy forms and blacklisting their IP addresses (rightfully called <a href="http://www.projecthoneypot.org/">Project Honey Pot</a>).  Again thanks to <a href="http://www.aaronjamesyoung.com/">Aaron</a> for reminding me about this technique, I&#8217;ve been meaning to do a write up on it for a while now.  This post is also thanks to <a href="http://forrst.com/">Forrst</a>, I&#8217;m quite pleasantly surprised at the amount of interesting information I&#8217;m finding there.</p> <img src="http://devgrow.com/?ak_action=api_record_view&id=1369&type=feed" alt="" /><ul><li><a href="http://devgrow.com/simple-threaded-comments-with-jcollapsible/" rel="bookmark">Simple Threaded Comments with jCollapsible (new jQuery Plugin)</a></li><li><a href="http://devgrow.com/best-bet-css-practices/" rel="bookmark">Best Bet CSS Practices</a></li><li><a href="http://devgrow.com/complete-guide-to-creating-your-first-website/" rel="bookmark">The Complete Guide to Creating Your First Website</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://devgrow.com/simple-php-honey-pot/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Quick SEO Tip 2: Submit Your Sitemap</title><link>http://devgrow.com/quick-seo-tip-2-submit-your-sitemap/</link> <comments>http://devgrow.com/quick-seo-tip-2-submit-your-sitemap/#comments</comments> <pubDate>Tue, 29 Jun 2010 17:31:54 +0000</pubDate> <dc:creator>Monji</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[quick seo tips]]></category> <category><![CDATA[seo]]></category> <category><![CDATA[seo tips]]></category> <category><![CDATA[sitemap]]></category><guid isPermaLink="false">http://devgrow.com/?p=1106</guid> <description><![CDATA[A sitemap is an index of pages and content found on your website. If you don&#8217;t have a sitemap yet, make one now using free sitemap generators or plugins. If you do have one, submit it to the big search engines to make sure your website is correctly indexed and ranked. Creating a Sitemap A [...]<ul><li><a href="http://devgrow.com/quick-seo-tip-set-preferred-domain-in-google-webmaster-tools/" rel="bookmark">Quick SEO Tip: Set Preferred Domain in Google Webmaster Tools</a></li></ul> ]]></description> <content:encoded><![CDATA[<p>A sitemap is an index of pages and content found on your website.  If you don&#8217;t have a sitemap yet, make one now using free sitemap generators or plugins.  If you do have one, submit it to the big search engines to make sure your website is correctly indexed and ranked.<span id="more-1106"></span></p><h2>Creating a Sitemap</h2><p>A sitemap is simply a listing of all the important pages of your website.  It&#8217;s a directory that can be easily and quickly understood by both search engines and visitors who may be lost.  Your sitemap can be a simple page on your website that lists all of the inner pages, but ideally you should use an XML sitemap, as it is preferred by most search engines.  The structure of your XML sitemap is simple:</p><div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br /> &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;urlset</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br /> &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br /> &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;loc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://devgrow.com/sharebar-wordpress-plugin/<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/loc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br /> &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;lastmod<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2010-06-16<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/lastmod<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br /> &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;changefreq<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>yearly<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/changefreq<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br /> &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;priority<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.8<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/priority<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br /> &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br /> &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br /> &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;loc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://devgrow.com/articles/<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/loc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br /> &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;lastmod<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2010-06-01<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/lastmod<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br /> &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;changefreq<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>weekly<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/changefreq<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br /> &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;priority<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.5<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/priority<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br /> &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br /> &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/urlset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div><p>The above example indexes two pages from my site, a blog post and the main article homepage.  Obviously this method can be time consuming if you have a lot of pages, and this is the perfect reason to use services like <a href="http://www.makeasitemap.com/">MakeASitemap.com</a> or the <a href="http://www.xml-sitemaps.com/">XML Sitemap Generator</a> to automatically index your site.  If you&#8217;re running WordPress, I highly recommend the <a href="http://www.arnebrachhold.de/redir/sitemap-home/">Google XML Sitemaps plugin</a>, which automates sitemap creation for you blog.  If you&#8217;ve manually created the file, save it in the root of your site.</p><h2>Submitting Your Sitemap</h2><p>After you&#8217;ve created your sitemap, submitting it to search engines is a great way to help them identify which pages on your site are worth crawling, how frequently they should be crawled and their overall search priority.  A good sitemap can help bring traffic to your site by essentially providing search engines with a guideline to correctly index and rank your pages.</p><p><strong>Places to submit your XML sitemap:</strong></p><ul><li><a href="http://google.com/webmasters/">Google Webmaster Tools</a></li><li><a href="http://siteexplorer.search.yahoo.com/">Yahoo! Site Explorer</a></li><li><a href="http://www.bing.com/webmaster">Bing Webmaster Tools</a></li></ul><p>You will have to login and verify you own the site in order to submit a sitemap, however it&#8217;s well worth the time.</p><h2>Conclusion</h2><p>If you haven&#8217;t submitted your sitemap, do so to help search engines better index and rank your pages.  If you&#8217;re using WordPress, be sure to check out that <a href="http://www.arnebrachhold.de/redir/sitemap-home/">Google XML Sitemaps plugin</a>, it can make life a heck of a lot easier.</p><p>If you have any other SEO tips, please leave them in the comments.  And as always, <a href="http://feeds.feedburner.com/devgrow">subscribe to the RSS feed</a> if you haven&#8217;t already and <a href="http://twitter.com/ThinkDevGrow">follow us on Twitter</a>!</p> <img src="http://devgrow.com/?ak_action=api_record_view&id=1106&type=feed" alt="" /><ul><li><a href="http://devgrow.com/quick-seo-tip-set-preferred-domain-in-google-webmaster-tools/" rel="bookmark">Quick SEO Tip: Set Preferred Domain in Google Webmaster Tools</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://devgrow.com/quick-seo-tip-2-submit-your-sitemap/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Simple Threaded Comments with jCollapsible (new jQuery Plugin)</title><link>http://devgrow.com/simple-threaded-comments-with-jcollapsible/</link> <comments>http://devgrow.com/simple-threaded-comments-with-jcollapsible/#comments</comments> <pubDate>Sun, 30 May 2010 20:27:25 +0000</pubDate> <dc:creator>Monji</dc:creator> <category><![CDATA[Resources]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[collapsible]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[threaded]]></category><guid isPermaLink="false">http://devgrow.com/?p=1127</guid> <description><![CDATA[The jCollapisble plugin takes any nested list (OL or UL that have children) and coverts it into collapsible threads.  This is especially useful to create simple threaded comments on a blog or nested posts in a forum without having to modify the backend code.<ul><li><a href="http://devgrow.com/griddy-overlay/" rel="bookmark">Griddy: Simple Grid Overlay Plugin for jQuery</a></li><li><a href="http://devgrow.com/slidernav/" rel="bookmark">SliderNav: iPhone Style Contact Lists Using jQuery and CSS</a></li><li><a href="http://devgrow.com/sharebar-wordpress-plugin/" rel="bookmark">Sharebar WordPress Plugin</a></li></ul> ]]></description> <content:encoded><![CDATA[<p><strong>jCollapisble</strong> is a JQuery plugin that takes any nested list (OL or UL that have children) and coverts it into collapsible threads.  This is especially useful to create simple threaded comments on a blog or forum without having to modify the backend code.  I&#8217;ve tried to keep the plugin as simple and bare-bones as possible, so right now there are no fancy slide or fade effects.  The only thing required is the plugin JS file itself &#8211; CSS and images are completely optional.<br /> <script type='text/javascript' src='http://devgrow.com/plugins/jcollapsible/jCollapsible.js'></script><script type='text/javascript'>$(document).ready(function(){$('#example').collapsible({xoffset:'-6',yoffset:'-2',defaulthide:false});$('#comments').collapsible({defaulthide:false,imageshow:'http://devgrow.com/plugins/jcollapsible/arrow-right.png',imagehide:'http://devgrow.com/plugins/jcollapsible/arrow-down.png',yoffset:'15'});});</script><br /><style>#example, #example ul{list-style:none}.jcollapsible{font-size:150%}</style><p>The plugin has been tested (and works fine) on Firefox 3, Chrome 5, IE7+, Safari 4 and Opera 10.  It should work on older browsers too though the CSS may need to be fiddled with.</p><h2>Example</h2><p>This page actually has the plugin enabled &#8211; you can see it in action on the following list or in the <a href="http://devgrow.com/simple-threaded-comments-with-jcollapsible/#comments">comments section</a>!</p><ul id="example"><li>Test Parent<ul><li>Test Child</li><li>Test Child 2</li></ul><li>Test Parent 2 (childless)</li><li>Test Parent 3<ul><li>Test Child<ul><li>Child Level 3</li></ul></li><li>Test Child 2</li></ul></ul><h2>Download</h2><p>You can download the <a href="http://devgrow.com/plugins/jcollapsible/jCollapsible.js">full source</a>, <a href="http://devgrow.com/plugins/jcollapsible/jCollapsible.min.js">minified version</a> or <a href="http://devgrow.com/plugins/jcollapsible">view the example online</a>.<br /><center><a href="http://devgrow.com/plugins/jcollapsible/jcollapsible.zip" class="download-button">jCollapsible Plugin (zip)</a><a href="http://devgrow.com/plugins/jcollapsible" class="download-button" style="margin-left:20px;">View Demo</a></center></p><h2>Usage Instructions</h2><p>SliderNav is super easy to use, but first you have to load JQuery, the plugin and the relevant CSS file in order to use it:</p><div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;jquery-1.4.2.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span><br /> <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;jCollapsible.min.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span><br /> <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">'text/javascript'</span><span style="color: #339933;">&gt;</span> <br /> $<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><br /> &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#example'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">collapsible</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>xoffset<span style="color: #339933;">:</span><span style="color: #3366CC;">'-10'</span><span style="color: #339933;">,</span>yoffset<span style="color: #339933;">:</span><span style="color: #3366CC;">'5'</span><span style="color: #339933;">,</span>defaulthide<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /> <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div><p>Simple enough &#8211; just include JQuery (1.3.2 and up), the jCollapsible file and then call the function with your settings.</p><h2>Customize the Icon or Use Images Instead</h2><p>While I did try to keep the plugin lightweight, I also wanted to make it somewhat extensible by adding a few different options, including:</p><ul><li><strong>defaulthide</strong> &#8211; hide all children by default (default: true)</li><li><strong>symbolhide</strong> &#8211; symbol to hide child elements (default: -)</li><li><strong>symbolshow</strong> &#8211; symbol to show child elements (default: +)</li><li><strong>imagehide</strong> &#8211; image to hide child elements (default: null)</li><li><strong>imageshow</strong> &#8211; image to show child elements (default: null)</li><li><strong>xoffset</strong> &#8211; amount pixels to move symbol/image horizontally (default: -15)</li><li><strong>yoffset</strong> &#8211; amount pixels to move symbol/image vertically (default: 0)</li></ul><p>Please note that the image values are null by default (using symbol instead) and the offset values are there to fine-tune the location of the image/symbol.</p><h2>The Code</h2><p>For those who are curious, here is the source for the code:</p><div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$.<span style="color: #660066;">fn</span>.<span style="color: #660066;">collapsible</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>options<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br /> &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> defaults <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>defaulthide<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> symbolhide<span style="color: #339933;">:</span> <span style="color: #3366CC;">'-'</span><span style="color: #339933;">,</span> symbolshow<span style="color: #339933;">:</span> <span style="color: #3366CC;">'+'</span><span style="color: #339933;">,</span> imagehide<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> imageshow<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> xoffset<span style="color: #339933;">:</span> <span style="color: #3366CC;">'-15'</span><span style="color: #339933;">,</span> yoffset<span style="color: #339933;">:</span> <span style="color: #3366CC;">'0'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> opts <span style="color: #339933;">=</span> $.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>defaults<span style="color: #339933;">,</span> options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #003366; font-weight: bold;">var</span> o <span style="color: #339933;">=</span> $.<span style="color: #660066;">meta</span> <span style="color: #339933;">?</span> $.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> opts<span style="color: #339933;">,</span> $$.<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> opts<span style="color: #339933;">;</span> <span style="color: #003366; font-weight: bold;">var</span> obj <span style="color: #339933;">=</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: #339933;">;</span><br /> &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>o.<span style="color: #660066;">imageshow</span><span style="color: #009900;">&#41;</span> o.<span style="color: #660066;">symbolshow</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;img src=&quot;'</span><span style="color: #339933;">+</span>o.<span style="color: #660066;">imageshow</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'&quot; class=&quot;jc-show&quot; border=&quot;0&quot;&gt;'</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>o.<span style="color: #660066;">imagehide</span><span style="color: #009900;">&#41;</span> o.<span style="color: #660066;">symbolhide</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;img src=&quot;'</span><span style="color: #339933;">+</span>o.<span style="color: #660066;">imagehide</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'&quot; class=&quot;jc-hide&quot; border=&quot;0&quot;&gt;'</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> startsymbol <span style="color: #339933;">=</span> o.<span style="color: #660066;">symbolshow</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #339933;">,</span> obj<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>index<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&gt;ul, &gt;ol'</span><span style="color: #339933;">,</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>o.<span style="color: #660066;">defaulthide</span><span style="color: #009900;">&#41;</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&gt;ul, &gt;ol'</span><span style="color: #339933;">,</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">else</span> startsymbol <span style="color: #339933;">=</span> o.<span style="color: #660066;">symbolhide</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<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;">prepend</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;a href=&quot;&quot; class=&quot;jcollapsible&quot; style=&quot;position:absolute;left:'</span><span style="color: #339933;">+</span>o.<span style="color: #660066;">xoffset</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'px;top:'</span><span style="color: #339933;">+</span>o.<span style="color: #660066;">yoffset</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'px;&quot;&gt;'</span><span style="color: #339933;">+</span>startsymbol<span style="color: #339933;">+</span><span style="color: #3366CC;">'&lt;/a&gt;'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'position'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'relative'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br /> &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.jcollapsible'</span><span style="color: #339933;">,</span> obj<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><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> parent <span style="color: #339933;">=</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;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&gt;ul, &gt;ol'</span><span style="color: #339933;">,</span>parent<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; $<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;">html</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;">html</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> o.<span style="color: #660066;">symbolshow</span> <span style="color: #339933;">?</span> o.<span style="color: #660066;">symbolhide</span> <span style="color: #339933;">:</span> o.<span style="color: #660066;">symbolshow</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div><p>I wasn&#8217;t exaggerating when I said this plugin was simple!  It first few lines initialize the plugin/function and set the default values.  The <code class="codecolorer text geshi"><span class="text">each</span></code> function creates the actual expand/collapse icons and the last function (<code class="codecolorer text geshi"><span class="text">click</span></code>) just toggles the child elements.</p><h2>Final Thoughts</h2><p>This plugin actually comes from a function I wrote for one of my personal projects, I just thought some of you guys may find it useful so I&#8217;ve wrapped it up as a plugin.  If you do use it (or like it), please leave some feedback, good or bad &#8211; it&#8217;s highly appreciated and helps me produce better work.</p><p>As always, <a href="http://feeds.feedburner.com/devgrow">subscribe to the feed</a> if you haven&#8217;t and <a href="http://twitter.com/thinkdevgrow">follow me on Twitter</a>!</p> <img src="http://devgrow.com/?ak_action=api_record_view&id=1127&type=feed" alt="" /><ul><li><a href="http://devgrow.com/griddy-overlay/" rel="bookmark">Griddy: Simple Grid Overlay Plugin for jQuery</a></li><li><a href="http://devgrow.com/slidernav/" rel="bookmark">SliderNav: iPhone Style Contact Lists Using jQuery and CSS</a></li><li><a href="http://devgrow.com/sharebar-wordpress-plugin/" rel="bookmark">Sharebar WordPress Plugin</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://devgrow.com/simple-threaded-comments-with-jcollapsible/feed/</wfw:commentRss> <slash:comments>26</slash:comments> </item> <item><title>Slick Animated Menus Using Only CSS3</title><link>http://devgrow.com/slick-animated-menus-using-only-css3/</link> <comments>http://devgrow.com/slick-animated-menus-using-only-css3/#comments</comments> <pubDate>Wed, 26 May 2010 18:30:27 +0000</pubDate> <dc:creator>Monji</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[animations]]></category> <category><![CDATA[css3]]></category> <category><![CDATA[design]]></category> <category><![CDATA[transitions]]></category> <category><![CDATA[web design]]></category><guid isPermaLink="false">http://devgrow.com/?p=1109</guid> <description><![CDATA[I&#8217;m always looking for ways to create neat looking effects with minimal code, so today we&#8217;ll take a look at a couple of slick animated menus made with CSS3 goodness. I was inspired by the menu system on Mashable for the first example, while the second one is popular on many tutorial sites (they use [...]<ul><li><a href="http://devgrow.com/super-simple-css-buttons/" rel="bookmark">Super Simple CSS Buttons</a></li><li><a href="http://devgrow.com/perfect-css3-buttons/" rel="bookmark">Creating the Perfect CSS3 Buttons</a></li><li><a href="http://devgrow.com/iphone-style-switches/" rel="bookmark">iPhone Style Radio and Checkbox Switches using jQuery and CSS</a></li></ul> ]]></description> <content:encoded><![CDATA[<p>I&#8217;m always looking for ways to create neat looking effects with minimal code, so today we&#8217;ll take a look at a couple of slick  animated menus made with CSS3 goodness.<span id="more-1109"></span> I was inspired by the menu system on <a href="http://www.mashable.com/">Mashable</a> for the first example, while the second one is popular on many <a href="http://tutorialzine.com/2009/09/stylish-navigation-menu-jquery/">tutorial</a> <a href="http://www.jqueryglobe.com/article/animated-menu">sites</a> (they use JQuery though).</p><h2>Demo</h2><p><iframe width="600" height="210" src="http://devgrow.com/examples/slickmenus/embed.html" style="border:none;" frameborder="0" marginheight="0" marginwidth="0"></iframe></p><h2>Download</h2><p>The zip file below contains the CSS and HTML to create all of the elements in the above example, as well as the image file used.<br /><center><a href="http://devgrow.com/examples/slickmenus/slickmenus.zip" class="download-button">Download Menu Examples (zip)</a><a href="http://devgrow.com/examples/slickmenus/" class="download-button" style="margin-left:20px;">Online Demo</a></center></p><h2>Example 1</h2><p>This is probably the more practical example, as it uses the standard/conventional menu markup that you are probably already using.  Applying it only requires adding the necessary class to your UL/OL element.</p><div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nav&quot;</span>&gt;</span><br /> &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;selected&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>Home<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>About Us<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>Portfolio<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>Services<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span></div></td></tr></tbody></table></div><p>The CSS for Example 1 is as follows:</p><div class="codecolorer-container css blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.nav</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.nav</span> li <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.nav</span> a <span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <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><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">4px</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#f4f4f4</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#999</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -webkit-transition<span style="color: #00AA00;">:</span> all 200ms ease-out<span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -moz-transition<span style="color: #00AA00;">:</span> all 200ms ease-out<span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -o-transition<span style="color: #00AA00;">:</span> all 200ms ease-out<span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; transition<span style="color: #00AA00;">:</span> all 200ms ease-out<span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.nav</span> a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-4px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.nav</span> <span style="color: #6666ff;">.selected</span> a<span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.nav</span> <span style="color: #6666ff;">.selected</span> a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#444</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div><p>The code is pretty self-explanatory but the key part to make note of are the <strong>transition</strong> properties applied to the <em>.nav a</em> selector &#8211; they produce the animation effect on CSS3 compatible browsers.  The first value is which effect the transition animation should apply to and in our example, it&#8217;s set to all (which will animate any and all changes possible).  The second is the duration of the animation, which in this case is 200 milliseconds.  The third is whether you want the animation to <em>ease-in</em>, <em>ease-out</em> or a combination of both &#8211; <em>ease-in-out</em>. Feel free to play with these settings as well as the actual changes in the element, including padding, border widths, height, etc. to get a feel of how the transition property works.</p><h2>Example 2</h2><p>While this animation arguably looks cooler, it requires a bit more effort when we&#8217;re not using Javascript.  Here is the HTML for example 2:</p><div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nav2&quot;</span>&gt;</span><br /> &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/strong.html"><span style="color: #000000; font-weight: bold;">strong</span></a>&gt;</span>Home<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/strong.html"><span style="color: #000000; font-weight: bold;">strong</span></a>&gt;&lt;<a href="http://december.com/html/4/element/em.html"><span style="color: #000000; font-weight: bold;">em</span></a>&gt;</span>Home<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/em.html"><span style="color: #000000; font-weight: bold;">em</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/strong.html"><span style="color: #000000; font-weight: bold;">strong</span></a>&gt;</span>About Us<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/strong.html"><span style="color: #000000; font-weight: bold;">strong</span></a>&gt;&lt;<a href="http://december.com/html/4/element/em.html"><span style="color: #000000; font-weight: bold;">em</span></a>&gt;</span>About Us<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/em.html"><span style="color: #000000; font-weight: bold;">em</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/strong.html"><span style="color: #000000; font-weight: bold;">strong</span></a>&gt;</span>Portfolio<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/strong.html"><span style="color: #000000; font-weight: bold;">strong</span></a>&gt;&lt;<a href="http://december.com/html/4/element/em.html"><span style="color: #000000; font-weight: bold;">em</span></a>&gt;</span>Portfolio<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/em.html"><span style="color: #000000; font-weight: bold;">em</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/strong.html"><span style="color: #000000; font-weight: bold;">strong</span></a>&gt;</span>Services<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/strong.html"><span style="color: #000000; font-weight: bold;">strong</span></a>&gt;&lt;<a href="http://december.com/html/4/element/em.html"><span style="color: #000000; font-weight: bold;">em</span></a>&gt;</span>Services<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/em.html"><span style="color: #000000; font-weight: bold;">em</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span></div></td></tr></tbody></table></div><p>The way it works is that two blocks are created, the first being the text in the <strong>strong</strong> element and the second being the <strong>em</strong> element.  The elements are stacked on top of each other with only one being visible at any given time (the other is hidden as the parent element has a fixed height and overflow set to hidden).  The transition property is applied to both objects and on mouseover, both objects shift up, producing the desired effect.</p><p>The CSS for Example 2:</p><div class="codecolorer-container css blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.nav2</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.nav2</span> li <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</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><br /> <span style="color: #6666ff;">.nav2</span> a <span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <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><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">22px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.nav2</span> a strong<span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.nav2</span> a em <span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <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><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">4px</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -webkit-transition<span style="color: #00AA00;">:</span> all 200ms ease-out<span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -moz-transition<span style="color: #00AA00;">:</span> all 200ms ease-out<span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -o-transition<span style="color: #00AA00;">:</span> all 200ms ease-out<span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; transition<span style="color: #00AA00;">:</span> all 200ms ease-out<span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.nav2</span> a strong <span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <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><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.nav2</span> em <span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <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><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100%</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.nav2</span> a<span style="color: #3333ff;">:hover </span>strong <span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-100%</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.nav2</span> a<span style="color: #3333ff;">:hover </span>em <span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div><h2>Browser Compatibility</h2><p>The examples only work on browsers that support the CSS3 transition property, which right now include Safari, Chrome and Firefox 3.7.  I believe the latest build of Opera should support it as well, though I haven&#8217;t tested it yet.  For all other browsers, they will degrade to standard CSS rollovers.</p><h2>Final Remarks</h2><p>This tutorial is meant to be more instructional than practical.  If I were attempting to produce the effect from the second example in the real world, chances are I would probably use JQuery to do it.  If you have any feedback on this technique, please leave a comment!</p><p>And as usual, please <a href="http://feeds.feedburner.com/devgrow">subscribe to the RSS feed</a> if you haven&#8217;t yet and <a href="http://twitter.com/ThinkDevGrow">follow us on Twitter</a>!</p> <img src="http://devgrow.com/?ak_action=api_record_view&id=1109&type=feed" alt="" /><ul><li><a href="http://devgrow.com/super-simple-css-buttons/" rel="bookmark">Super Simple CSS Buttons</a></li><li><a href="http://devgrow.com/perfect-css3-buttons/" rel="bookmark">Creating the Perfect CSS3 Buttons</a></li><li><a href="http://devgrow.com/iphone-style-switches/" rel="bookmark">iPhone Style Radio and Checkbox Switches using jQuery and CSS</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://devgrow.com/slick-animated-menus-using-only-css3/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Super Simple CSS Buttons</title><link>http://devgrow.com/super-simple-css-buttons/</link> <comments>http://devgrow.com/super-simple-css-buttons/#comments</comments> <pubDate>Fri, 21 May 2010 23:47:28 +0000</pubDate> <dc:creator>Monji</dc:creator> <category><![CDATA[Tutorials]]></category> <category><![CDATA[buttons]]></category> <category><![CDATA[css]]></category> <category><![CDATA[design]]></category> <category><![CDATA[html]]></category> <category><![CDATA[web design]]></category><guid isPermaLink="false">http://devgrow.com/?p=1080</guid> <description><![CDATA[While playing around with a few button designs for my latest project, I came up with a simple CSS-only button system that is both lightweight and compatible with nearly all major browsers. Check it out and let me know what you think! Examples Download The zip file below contains the CSS and HTML to create [...]<ul><li><a href="http://devgrow.com/perfect-css3-buttons/" rel="bookmark">Creating the Perfect CSS3 Buttons</a></li><li><a href="http://devgrow.com/realistic-buttons-in-photoshop/" rel="bookmark">How to Create Realistic Buttons in Photoshop</a></li><li><a href="http://devgrow.com/slick-animated-menus-using-only-css3/" rel="bookmark">Slick Animated Menus Using Only CSS3</a></li></ul> ]]></description> <content:encoded><![CDATA[<p>While playing around with a few button designs for my latest project, I came up with a simple CSS-only button system that is both lightweight and compatible with nearly all major browsers.  Check it out and let me know what you think!<span id="more-1080"></span></p><h2>Examples</h2><p><iframe width="600" height="300" src="http://devgrow.com/examples/cssbuttons/embed.html" style="border:none;" frameborder="0" marginheight="0" marginwidth="0"></iframe></p><h2>Download</h2><p>The zip file below contains the CSS and HTML to create all of the elements in the above example, as well as the image file used.<br /><center><a href="http://devgrow.com/examples/cssbuttons/cssbuttons.zip" class="download-button">Simple CSS Buttons (zip)</a><a href="http://devgrow.com/examples/cssbuttons/" class="download-button" style="margin-left:20px;">Examples</a></center></p><h2>The HTML</h2><p>I wanted to keep it dead simple to use, enough so that a single class could be added to any element to create a button.  The HTML I used in the example is as follows:</p><div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://google.com/'</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'button'</span>&gt;</span>Google<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span><br /> <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://bing.com/'</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'button red'</span>&gt;</span>Bing<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span><br /> <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://devgrow.com/'</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'button large green'</span>&gt;</span>DevGrow<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span></div></td></tr></tbody></table></div><h2>The CSS</h2><p>In order to add a subtle gradient effect, I decided to use a single <a href="http://devgrow.com/examples/cssbuttons/button.png">image file</a>.  If you really want, you can leave that out and the buttons should still work fine.  To give you an idea of how it can be customized, I created styles for 7 additional colors and 3 different sizes.</p><div class="codecolorer-container css blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.button</span> <span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#777</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">button.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <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><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; -webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#666</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-48px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span><span style="color: #3333ff;">:active </span><span style="color: #00AA00;">&#123;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <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><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span> <span style="color: #933;">10px</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span><br /> &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span>.<span style="color: #993333;">red</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#e50000</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span>.<span style="color: #993333;">purple</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#9400bf</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span>.<span style="color: #993333;">green</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#58aa00</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span><span style="color: #6666ff;">.orange</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ff9c00</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span>.<span style="color: #000000; font-weight: bold;">blue</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2c6da0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span>.<span style="color: #000000; font-weight: bold;">black</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span>.<span style="color: #993333;">white</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span><span style="color: #6666ff;">.small</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">75%</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #933;">7px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span><span style="color: #6666ff;">.small</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-50px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span><span style="color: #6666ff;">.small</span><span style="color: #3333ff;">:active </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">4px</span> <span style="color: #933;">7px</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span>.<span style="color: #993333;">large</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">125%</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">7px</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span>.<span style="color: #993333;">large</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-35px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br /> <span style="color: #6666ff;">.button</span>.<span style="color: #993333;">large</span><span style="color: #3333ff;">:active </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">8px</span> <span style="color: #933;">12px</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div><p>The CSS is pretty self-explanatory, however an interesting point is that I change the padding in the active state (<em>.button:active</em>) while shifting the element up by 1 pixel &#8211; this creates a pseudo-3D effect of physically pushing down on it.</p><h2>Compatibility and Final Remarks</h2><p>While the buttons themselves do work on all major browsers (FF, Safari, Opera, Chrome, IE7+), certain effects may not be available on all browsers.  For instance, IE and Opera will not render rounded corners.</p><p>Play with it and let me know what you guys think!  I&#8217;m sure most of you designers already have your own button code &#8211; if you&#8217;d like to share it, please post it in the comments (directly or as a link) so the other readers can check it out!</p><p>Also, if you haven&#8217;t already, please consider <a href="http://feeds.feedburner.com/devgrow">subscribing to the RSS feed</a> or <a href="http://twitter.com/ThinkDevGrow">following us on Twitter</a>.</p> <img src="http://devgrow.com/?ak_action=api_record_view&id=1080&type=feed" alt="" /><ul><li><a href="http://devgrow.com/perfect-css3-buttons/" rel="bookmark">Creating the Perfect CSS3 Buttons</a></li><li><a href="http://devgrow.com/realistic-buttons-in-photoshop/" rel="bookmark">How to Create Realistic Buttons in Photoshop</a></li><li><a href="http://devgrow.com/slick-animated-menus-using-only-css3/" rel="bookmark">Slick Animated Menus Using Only CSS3</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://devgrow.com/super-simple-css-buttons/feed/</wfw:commentRss> <slash:comments>10</slash:comments> </item> <item><title>SliderNav: iPhone Style Contact Lists Using jQuery and CSS</title><link>http://devgrow.com/slidernav/</link> <comments>http://devgrow.com/slidernav/#comments</comments> <pubDate>Tue, 18 May 2010 00:24:42 +0000</pubDate> <dc:creator>Monji</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Tutorials]]></category> <category><![CDATA[apple]]></category> <category><![CDATA[iphone]]></category> <category><![CDATA[iphone-style]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[jquery plugin]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[slidernav]]></category> <category><![CDATA[widgets]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://devgrow.com/?p=1025</guid> <description><![CDATA[This effect is actually from Techi.com, a new blog launched by the guys at WebDesignerDepot, where they use it to display their popular tags in the sidebar. I wanted to see how easy (or hard) it was to recreate using JQuery and CSS, and it turns out that it&#8217;s pretty simple to do. I&#8217;ve packed [...]<ul><li><a href="http://devgrow.com/iphone-style-switches/" rel="bookmark">iPhone Style Radio and Checkbox Switches using jQuery and CSS</a></li><li><a href="http://devgrow.com/simple-threaded-comments-with-jcollapsible/" rel="bookmark">Simple Threaded Comments with jCollapsible (new jQuery Plugin)</a></li><li><a href="http://devgrow.com/quick-tip-preventing-right-click-context-menu-with-jquery/" rel="bookmark">Quick Tip: Preventing Right-Click Context Menu with jQuery</a></li></ul> ]]></description> <content:encoded><![CDATA[<p>This effect is actually from <a href="http://techi.com/">Techi.com</a>, a new blog launched by the guys at <a href="http://webdesignerdepot.com/">WebDesignerDepot</a>, where they use it to display their popular tags in the sidebar.  I wanted to see how easy (or hard) it was to recreate using JQuery and CSS, and it turns out that it&#8217;s pretty simple to do.  I&#8217;ve packed it into a neat little plugin so you hopefully you can make some use of it!<span id="more-1025"></span></p><p class="note"><strong>Updated May 25:</strong> I&#8217;ve just added a new option that displays arrows above and below the SliderNav object.  This is used to navigate longer sections for users that do not have a mouse wheel (or those who are on a mobile browser).</p><p><iframe width="600" height="310" src="http://devgrow.com/slidernav-jquery-plugin/embed.html" style="border:none;" frameborder="0" marginheight="0" marginwidth="0"></iframe></p><p><strong>SliderNav</strong> is a JQuery plugin that lets you add dynamic, sliding content using a vertical navigation bar (index).  It is made mainly for alphabetical listings but can be used with anything, though longer words can look a bit awkward.  The plugin automatically adds the navigation and sets the height for the object based on how tall the navigation is, in order to make sure users have access to the entire list.  I also used the <em>overflow: auto;</em> property for the actual content so you can <strong>use your mousewheel to scroll through the content as well</strong>.</p><p>The plugin has been tested (and works fine) on Firefox 3, Chrome 5, IE7, Safari 4 and Opera 10.</p><h2>Download</h2><p>You can download the <a href="http://devgrow.com/slidernav-jquery-plugin/slidernav.js">full source</a>, <a href="http://devgrow.com/slidernav-jquery-plugin/slidernav-min.js">minified version</a>, <a href="http://devgrow.com/slidernav-jquery-plugin/slidernav.css">css file</a>, or <a href="http://devgrow.com/slidernav-jquery-plugin">view the example online</a>.<br /><center><a href="http://devgrow.com/slidernav-jquery-plugin/slidernav.zip" class="download-button">SliderNav Plugin (zip)</a><a href="http://devgrow.com/slidernav-jquery-plugin" class="download-button" style="margin-left:20px;">View Demo</a></center></p><h2>Usage Instructions</h2><p>SliderNav is super easy to use, but first you have to load JQuery, the plugin and the relevant CSS file in order to use it:</p><div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>link rel<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;stylesheet&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span> href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;slidernav.css&quot;</span> media<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;screen, projection&quot;</span> <span style="color: #339933;">/&gt;</span><br /> <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;jquery-1.4.2.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span><br /> <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;slidernav.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div><p>After you&#8217;ve done that, create the section content in HTML using the following structure (you can name your element anything):</p><div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;slider&quot;</span>&gt;</span><br /> &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;slider-content&quot;</span>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;a&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;a&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;title&quot;</span>&gt;</span>A<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>Adam<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>Alex<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>Ali<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>Apple<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>Arthur<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>Ashley<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;b&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;b&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;title&quot;</span>&gt;</span>B<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>Barry<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>Becky<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>Biff<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>Billy<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>Bozarking<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/&quot;</span>&gt;</span>Bryan<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; etc...<br /> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br /> &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br /> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></td></tr></tbody></table></div><p>Once you&#8217;ve set the HTML, it&#8217;s simply a matter of calling the sliderNav function for the element you&#8217;ve just created:</p><div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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><br /> &nbsp; &nbsp; $<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><br /> &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#slider'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">sliderNav</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /> &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /> <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div><h4>Custom Options</h4><p>The first of the configurations is <strong>height</strong> &#8211; set this to a pixel value if you wish to override the automatic detection based on the vertical navigation (you may need to change the min-height in the CSS too).  Also by default, the plugin will generate an alphabetical navigation that uses all 26 letters of the English alphabet, however you can also use custom <strong>items</strong> using the following code:</p><div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#slider'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">sliderNav</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>items<span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'item1'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'item2'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'item3'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span><span style="color: #3366CC;">'200'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div><p>You can also set <strong>arrows</strong> to true (default) or false, which displays arrows above and below the slider object to allow scrolling longer sections.  Click on an arrow will scroll the object by it&#8217;s height &#8211; I used this method to keep code to the minimum, as anything smoother/nicer-looking required a lot more code.  The last customizable option is <strong>debug</strong>, which can either be <em>true</em> or <em>false</em>.  This adds a little bit of text on the bottom of the slider that shows how many pixels the current offset is (was useful during early development, probably not anymore).</p><h2>Possible Use Cases</h2><p>I believe this navigation can be useful in certain circumstances, mainly where you&#8217;re trying to show a lot of information that has been organized alphabetically (or by date) in a small area.  For instance, it could be used to create a WordPress widget that lists all posts alphabetically or better yet, a widget for complete archives categorized by date.  I&#8217;m not sure how much better it would be than traditional means of navigation but it&#8217;s certainly worth trying out.</p><h2>Conclusion</h2><p>As usual, please leave any feedback if you have it.  I&#8217;m still very new to the JQuery plugin scene so there may be bugs or mistakes &#8211; if you find one, please mention it in the comments.</p><p>If you haven&#8217;t yet, please <a href="http://feeds.feedburner.com/devgrow">subscribe to the RSS feed</a> and <a href="http://twitter.com/devgrowblog">follow us on Twitter</a> for more plugins and other useful bits!</p> <img src="http://devgrow.com/?ak_action=api_record_view&id=1025&type=feed" alt="" /><ul><li><a href="http://devgrow.com/iphone-style-switches/" rel="bookmark">iPhone Style Radio and Checkbox Switches using jQuery and CSS</a></li><li><a href="http://devgrow.com/simple-threaded-comments-with-jcollapsible/" rel="bookmark">Simple Threaded Comments with jCollapsible (new jQuery Plugin)</a></li><li><a href="http://devgrow.com/quick-tip-preventing-right-click-context-menu-with-jquery/" rel="bookmark">Quick Tip: Preventing Right-Click Context Menu with jQuery</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://devgrow.com/slidernav/feed/</wfw:commentRss> <slash:comments>49</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching using disk
Object Caching 4732/4873 objects using disk
Content Delivery Network via media1.devgrow.com

Served from: devgrow.com @ 2010-09-09 07:53:09 -->