<?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>tobypitman.com</title>
	<atom:link href="http://www.tobypitman.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tobypitman.com</link>
	<description>Official website of guitarist Toby Pitman</description>
	<lastBuildDate>Thu, 24 Jun 2010 14:24:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iPhone Style Checkboxes With CSS3</title>
		<link>http://www.tobypitman.com/iphone-style-checkboxes-with-css3/</link>
		<comments>http://www.tobypitman.com/iphone-style-checkboxes-with-css3/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 16:44:49 +0000</pubDate>
		<dc:creator>Toby</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.tobypitman.com/?p=355</guid>
		<description><![CDATA[Here's some form input checkboxes styled with CSS3 to look like iPhone style on/off buttons.]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-357" title="iphone-checkboxes" src="http://www.tobypitman.com/wp-content/uploads/2010/06/iphone-checkboxes.png" alt="" width="590" height="267" /></p>
<p>Here&#8217;s some form input checkboxes styled with CSS3 to look like iPhone style on/off buttons. Just messing about again with CSS3.</p>
<p>It&#8217;s all done with an input &#8216;checkbox&#8217; an a couple of labels. There&#8217;s no javascript to add any classes and the on/off text is added using the :before and :after pseudo classes in CSS with generated content, there are also no images used. It should work cross browser although I haven&#8217;t tested IE and Opera. Shoudn&#8217;t take too much tweaking if you want to try, I just didn&#8217;t have time.</p>
<p>There&#8217;s some -webkit- animations for Chrome and Safari. The clever bit is using the label to switch the checkbox off and on using the &#8216;for&#8217; attribute whick targets the &#8216;id&#8217; of the checkbox. Like this:</p>
<pre>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;input id=&quot;1&quot; checked=&quot;checked&quot; name=&quot;1&quot; type=&quot;checkbox&quot; value=&quot;1&quot; /&gt;<br />
&lt;label class=&quot;check&quot; for=&quot;1&quot;&gt;&lt;/label&gt;</div></div>
</pre>
<p>The label is then styled to have a different position using :checked. The checkbox itself is hidden.</p>
<pre>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">input[type=checkbox]:checked + label.check {<br />
&nbsp; &nbsp; top: 0px;<br />
&nbsp; &nbsp; left: 38px;<br />
}</div></div>
</pre>
<p>This CSS looks at any checkbox that&#8217;s &#8216;checked&#8217; and moves the next available label element with a class of &#8216;check&#8217; 38px left. Pretty cool!! Check out the source for more detail! <img src='http://www.tobypitman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a class="viewdemo" href="http://development.tobypitman.com/iphoneCheckboxes/iphoneCheckboxes2.html">View Demo</a></p>
<p>Ironically this doesn&#8217;t work on the iPhone!!?</p>
<p>P.S. This &#8216;experiment&#8217; wasn&#8217;t intended to simulate any kind of &#8216;drag&#8217; feature on the iPhone, it was just a try at making a pretty looking checkbox. It&#8217;s not a radiobox either, although you could probably use it for that too! All I was interested in was the CSS and just seeing if it was possible to achieve this kind of interface design without lots of extra bulky markup or JS. Sorry for any confusion or offence caused. <img src='http://www.tobypitman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Update: Here&#8217;s a UI example that doesn&#8217;t look like the iPhone buttons. Maybe this is a bit clearer as to how it may be used.</p>
<p><img class="aligncenter size-full wp-image-373" title="preview2" src="http://www.tobypitman.com/wp-content/uploads/2010/06/preview21.png" alt="" width="590" height="418" /></p>
<p><a class="viewdemo" href="http://development.tobypitman.com/iphoneCheckboxes/settings.html">View  Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobypitman.com/iphone-style-checkboxes-with-css3/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>CSS3 Scrolling Header Image</title>
		<link>http://www.tobypitman.com/css3-scrolling-header-image/</link>
		<comments>http://www.tobypitman.com/css3-scrolling-header-image/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 22:00:03 +0000</pubDate>
		<dc:creator>Toby</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.tobypitman.com/?p=342</guid>
		<description><![CDATA[Here's a cool thing you can do with the CSS3 animations behaviour. An infinitely scrollling header image!!]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tobypitman.com/wp-content/uploads/2010/06/clouds.png"><img class="aligncenter size-full wp-image-343" title="clouds" src="http://www.tobypitman.com/wp-content/uploads/2010/06/clouds.png" alt="" width="590" height="208" /></a></p>
<p>Here&#8217;s a cool thing you can do with the CSS3 animations behaviour. An infinitely scrollling header image!!</p>
<p>Take an image exactly 3 times the height of your header (make sure it tiles!! I use the &#8216;offset&#8217; plugin in Photoshop ) and assign it to the background of the header. In this example my image is 450px high.</p>
<pre>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#header {<br />
&nbsp; &nbsp; height: 150px;<br />
&nbsp; &nbsp; background-image: url(cloud.png);<br />
&nbsp; &nbsp; background-position: 0% 0%;<br />
}</div></div>
</pre>
<p>You&#8217;ll need to assign &#8216;background-image&#8217; and &#8216;background-position&#8217; separately.</p>
<p>Now build a @-webkit-keyframes animation like so. The &#8216;moveIt&#8217; is the name of the animation.</p>
<pre>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">@-webkit-keyframes moveIt {<br />
&nbsp; &nbsp; &nbsp;0% {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background-position: 0% 0%;<br />
&nbsp; &nbsp; &nbsp;}<br />
&nbsp; &nbsp; &nbsp;100% {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background-position: 0% 150%;<br />
&nbsp; &nbsp; &nbsp;}<br />
}</div></div>
</pre>
<p>As of today Safari is the only browser that supports these types of animations so you&#8217;ll have to use it to view the demo.</p>
<p>Now assign the animation behaviours to the header CSS.</p>
<pre>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#header {<br />
&nbsp; &nbsp; height: 150px;<br />
&nbsp; &nbsp; background-image: url(cloud.png);<br />
&nbsp; &nbsp; background-position: 0% 0%;<br />
&nbsp; &nbsp; -webkit-animation-name: moveIt;<br />
&nbsp; &nbsp; -webkit-animation-duration: 20s;<br />
&nbsp; &nbsp; -webkit-animation-iteration-count: infinite;<br />
&nbsp; &nbsp; -webkit-animation-timing-function: linear;<br />
}</div></div>
</pre>
<p>You can see I&#8217;ve called the animation name &#8216;moveIt&#8217;. Then we have &#8216;duration&#8217;, count and timing. In the actual animation setup the image is being moved 150% of the height of the header. This seems to line up the images as it jumps back to zero. Don&#8217;t ask me how I worked this out I just got lucky!!! <img src='http://www.tobypitman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a class="viewdemo" href="http://development.tobypitman.com/clouds/clouds.html">View the Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobypitman.com/css3-scrolling-header-image/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Pure CSS Sliding Image Gallery</title>
		<link>http://www.tobypitman.com/pure-css-sliding-image-gallery/</link>
		<comments>http://www.tobypitman.com/pure-css-sliding-image-gallery/#comments</comments>
		<pubDate>Mon, 03 May 2010 17:36:52 +0000</pubDate>
		<dc:creator>Toby</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.tobypitman.com/?p=332</guid>
		<description><![CDATA[So, another random CSS3 experiment! This time it's an image gallery that has a slide effect.]]></description>
			<content:encoded><![CDATA[<p>So, another random CSS3 experiment! This time it&#8217;s an image gallery that has a slide effect. </p>
<p>This was a bit tricky to work out but I got there in the end. The idea is to get one image to slide in while the current image slides out. There&#8217;s a lot of z-index going on as well so the new image always appears to be at the top.</p>
<p>I&#8217;m not totally sure how I got the z-index to work or why it does! One thing I&#8217;m sure of is you have to use CSS Animations, not Transitions! There are two main @keyframe set ups for this webkit animation. </p>
<p>One to animate the :target image in</p>
<pre>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/* Animation for the :target image. Slides the image in. */<br />
<br />
@-webkit-keyframes moveTarget {<br />
&nbsp; &nbsp; 0% {<br />
&nbsp; &nbsp; &nbsp; &nbsp; left:-700px;&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; 100% { <br />
&nbsp; &nbsp; &nbsp; &nbsp; left:0px;<br />
&nbsp; &nbsp; }<br />
}<br />
<br />
<br />
ul#slider li:target {<br />
&nbsp; &nbsp; -webkit-animation-name: moveTarget; <br />
&nbsp; &nbsp; -webkit-animation-duration: .5s; <br />
&nbsp; &nbsp; -webkit-animation-iteration-count: 1;<br />
&nbsp; &nbsp; top:0px;<br />
&nbsp; &nbsp; left: 0px;<br />
&nbsp; &nbsp; z-index: 10;<br />
}</div></div>
</pre>
<p>And one to move the current :target image out</p>
<pre>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/*<br />
Animation for the current image. Slides it out and back to the starting position. <br />
Adds a lower z-index than the now current image.<br />
*/<br />
<br />
@-webkit-keyframes moveIt {<br />
&nbsp; &nbsp; 0% {<br />
&nbsp; &nbsp; &nbsp; &nbsp; left:0px; &nbsp; <br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; 50% {<br />
&nbsp; &nbsp; &nbsp; &nbsp; left:700px; <br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; 100% { <br />
&nbsp; &nbsp; &nbsp; &nbsp; left:-700px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; z-index: 5;<br />
&nbsp; &nbsp; }<br />
}<br />
<br />
ul#slider li:not(:target) {<br />
&nbsp; &nbsp; -webkit-animation-name: moveIt; <br />
&nbsp; &nbsp; -webkit-animation-duration: 1.5s; <br />
&nbsp; &nbsp; -webkit-animation-iteration-count: 1;<br />
&nbsp; &nbsp; top:0px;<br />
&nbsp; &nbsp; left: 0px;<br />
}</div></div>
</pre>
<p>The first animation has one step over 0.5 secs. The second has three over 1.5secs. I&#8217;m sure you get the picture. The time it takes for the for the image to move in is the time it take for the other image to move out (50%)  before it get&#8217;s returned to the start position ready to come in again. The image moving out is given a lower z-index so it isn&#8217;t seen moving behind the current image to the start position.</p>
<p>Here&#8217;s a picture!</p>
<p><img src="http://www.tobypitman.com/wp-content/uploads/2010/05/move.png" alt="" title="move" width="589" height="202" class="aligncenter size-full wp-image-334" /></p>
<p>Plays nice in Firefox and Opera too just without the animation. I&#8217;ve not looked at it in IE as I&#8217;m on a Mac and just can&#8217;t be arsed to deal with it as this is just a bit of fun. It doesn&#8217;t support :target so it won&#8217;t work anyway. Maybe in IE9?</p>
<p>Yes it looks like Galleria, needed some quick images. Maybe this could prove to be a leaner alternative in the future for image galleries and featured content sliders. I&#8217;ve no doubt this could be intergated into Wordpress very easily or some kind of dynamic PHP gallery (from a folder of images) script.</p>
<p>Anyway, you can have a look at the demo and decide for yourself. <img src='http://www.tobypitman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a class="viewdemo" href="http://development.tobypitman.com/slideshow/index3.html">Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobypitman.com/pure-css-sliding-image-gallery/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Custom Post Structures in Wordpress Loop</title>
		<link>http://www.tobypitman.com/custom-post-structures-in-wordpress-loop/</link>
		<comments>http://www.tobypitman.com/custom-post-structures-in-wordpress-loop/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 17:13:50 +0000</pubDate>
		<dc:creator>Toby</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.tobypitman.com/?p=321</guid>
		<description><![CDATA[Here's a spicy little Wordpress loop that allows you to structure your latest posts in a different way.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tobypitman.com/wp-content/uploads/2010/04/php.png"><img src="http://www.tobypitman.com/wp-content/uploads/2010/04/php.png" alt="" title="php" width="572" height="169" class="aligncenter size-full wp-image-322" /></a></p>
<p>Here&#8217;s a spicy little Wordpress loop that allows you to structure your latest posts in a different way.</p>
<p>The great thing about this is that it will only effect the first page of your posts. All subsequent posts on an &#8216;Older Posts&#8217; page will not repeat the structure.</p>
<p>Here is the basic loop, by the way I can&#8217;t remember where this came from but I didn&#8217;t write it&#8230;.but it&#8217;s bloody useful though!!!</p>
<pre>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><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> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$post</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$posts</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$paged</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
&nbsp; &nbsp; /* &nbsp;Stuff for your Latest Post goes here! &nbsp; */<br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span> &nbsp;<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
&nbsp; &nbsp; /* &nbsp;All other posts goes here! &nbsp; */<br />
<br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
</pre>
<p>It basically counts through your posts, 1 is your latest post (0 being no posts) and lets you write a separate structure for it. The &#8216;else&#8217; refers to all posts that aren&#8217;t 1 or the latest. The key is the &#8216;$paged&#8217; bit which see if the pages are related.</p>
<p>I took this a step further (yep, I wrote this bit with my ropey PHP skills!!!) by adding an &#8216;elseif&#8217; statement that lets you define another set of posts for further structuring. In the code below it say any post greater or equal to 2 but less than four should have it&#8217;s own loop structure. Now the &#8216;else&#8217; refers to any post equal or greater than fourth in the list. Cool! </p>
<pre>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><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> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$post</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$posts</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$paged</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
&nbsp; &nbsp; /* &nbsp;Stuff for your Latest Post goes here! &nbsp; */<br />
<br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$paged</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
&nbsp; &nbsp; /* &nbsp;Stuff for your the next two Latest Posts goes here! &nbsp; */<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span> &nbsp;<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
&nbsp; &nbsp; /* &nbsp;All other posts goes here! &nbsp; */<br />
<br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
</pre>
<p>Here&#8217;s an example the different post structures you could achieve using this.</p>
<pre>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><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> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$post</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$posts</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$paged</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
&nbsp; &nbsp; &lt;div id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; <span style="color: #000000; font-weight: bold;">&lt;?php</span> post_class<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'latest'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'full'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;h2 class=&quot;entry-title&quot;&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;div&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;&nbsp; <br />
&nbsp; &nbsp; &lt;/div&gt;<br />
<br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$paged</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
&nbsp; &nbsp; &lt;div id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; <span style="color: #000000; font-weight: bold;">&lt;?php</span> post_class<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'not-so-latest'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'medium'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;h2 class=&quot;entry-title&quot;&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;div&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;<br />
&nbsp; &nbsp; &lt;/div&gt;<br />
<br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span> &nbsp;<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
&nbsp; &nbsp; &lt;div id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; <span style="color: #000000; font-weight: bold;">&lt;?php</span> post_class<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'just-plain-old'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thumbnail'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;h2 class=&quot;entry-title&quot;&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;div&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;&nbsp; <br />
&nbsp; &nbsp; &lt;/div&gt;<br />
<br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
</pre>
<p>Here&#8217;s a picture!!!!</p>
<p><img src="http://www.tobypitman.com/wp-content/uploads/2010/04/post-structure.png" alt="" title="post-structure" width="590" height="430" class="aligncenter size-full wp-image-324" /></p>
<p>The first post has a full size &#8216;post_thumbnail&#8217; image, a post link and &#8216;the content&#8217;.</p>
<p>The second and third have a medium &#8216;post_thumbnail&#8217; image, a post link and &#8216;the excerpt&#8217;. The fourth and any post after will have small thumbnail, a post link and &#8216;the excerpt&#8217;.</p>
<p>You&#8217;ll notice I&#8217;ve also added a custom class into the &#8216;post_class&#8217; tag for easy styling.</p>
<pre>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><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> post_class<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'latest'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
</pre>
<p>Here&#8217;s what you get!!!</p>
<p><img src="http://www.tobypitman.com/wp-content/uploads/2010/04/css-structure.png" alt="" title="css-structure" width="590" height="430" class="aligncenter size-full wp-image-325" /></p>
<p>I&#8217;m rolling out a new theme soon when Wordpress 3 is out. I&#8217;m really enjoying the new loop structure which is making theme development a lot easier. Will post up some more useful snippets that I&#8217;ve used in my new theme that is a lot simpler.</p>
<p>Hope this helps somebody out!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobypitman.com/custom-post-structures-in-wordpress-loop/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dynamic CSS3 Animated Accordian Menu</title>
		<link>http://www.tobypitman.com/dynamic-css3-animated-accordian-menu/</link>
		<comments>http://www.tobypitman.com/dynamic-css3-animated-accordian-menu/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 12:34:49 +0000</pubDate>
		<dc:creator>Toby</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.tobypitman.com/?p=292</guid>
		<description><![CDATA[So I've been doing some more CSS3 experiments and I think I've cracked the Accordian thing. I actually tried this out ages ago and ran into the same problems other people had had, namely animating the height of an enclosing element couldn't be dynamic.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tobypitman.com/wp-content/uploads/2010/04/text.png"><img src="http://www.tobypitman.com/wp-content/uploads/2010/04/text.png" alt="" title="text" width="590" height="307" class="alignleft size-full wp-image-314" /></a></p>
<p>So I&#8217;ve been doing some more CSS3 experiments and I think I&#8217;ve cracked the Accordian thing. I actually tried this out ages ago <a href="http://development.tobypitman.com/css/accordion.html">2008 Demo</a> and ran into the same problems other people had later on, namely animating the height of an enclosing element couldn&#8217;t be dynamic it had to be fixed.</p>
<p>What do I mean? If your using CSS3 Transitions you have to have a start and end value, say.</p>
<pre>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">div <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; -webkit-transition<span style="color: #00AA00;">:</span> all .5s ease-in-out<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;">0px</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
div<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
</pre>
<p>The issue was how do you know how high each of the accordian panels are that your animating? Each one might have a different number of elements. Now CSS doesn&#8217;t allow any sort of  loops or math like Javascript so you can&#8217;t find out the height based on the number of elements.</p>
<p>Then it hit me! Why bother with the container height and instead focus on the elements inside it! All the things you&#8217;d put inside a div are going to have static values right, like say an &#8216;a&#8217; tags height. Why not animate that instead thus causing the container to collapse.</p>
<p>Let&#8217;s start with an Accordian menu. Here&#8217;s the basic markup, a simple <em>ul</em> with <em>li&#8217;s</em>.</p>
<pre>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;ul class=&quot;menu&quot;&gt;<br />
&lt;li class=&quot;title&quot;&gt;&lt;a id=&quot;1&quot; href=&quot;#1&quot;&gt;&lt;span&gt;Stuff&lt;/span&gt;&lt;/a&gt;<br />
&nbsp; &nbsp; &lt;ul&gt;<br />
&nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;list&lt;/a&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;list&lt;/a&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;list&lt;/a&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;list&lt;/a&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;list&lt;/a&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;list&lt;/a&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;list&lt;/a&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;list&lt;/a&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &lt;/ul&gt;<br />
&lt;/li&gt;<br />
<br />
&lt;li class=&quot;title&quot;&gt;&lt;a id=&quot;2&quot; href=&quot;#2&quot;&gt;&lt;span&gt;Stuff&lt;/span&gt;&lt;/a&gt;<br />
&nbsp; &nbsp; &lt;ul&gt;<br />
&nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;list&lt;/a&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;list&lt;/a&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;#&quot;&gt;list&lt;/a&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &lt;/ul&gt;<br />
&lt;/li&gt;<br />
&lt;/ul&gt;</div></div>
</pre>
<p>You&#8217;ll notice that the &#8216;a&#8217; has an &#8216;id&#8217; and the &#8216;href&#8217; is targeting that id. This allows us to use the CSS3 <em>:target</em> selector for our animation, you&#8217;ll notice it&#8217;s actually targeting itself! I&#8217;ve done this for a reason.</p>
<pre>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.title</span> ul li a <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; -webkit-transition<span style="color: #00AA00;">:</span> all .5s ease-in-out<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;">0px</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; <br />
&nbsp;<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #3333ff;">:target </span><span style="color: #00AA00;">+</span> ul li a <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #00AA00;">&#125;</span></div></div>
</pre>
<p>In the above CSS you&#8217;ll see I&#8217;ve used the &#8216;+&#8217; adjacent sibling selector when using <em>:target</em>. This says effect the next <em>ul&#8217;s</em> list items &#8216;a&#8217; tags. When they shrink the enclosing &#8216;ul&#8217; is then effectively invisible as there is no &#8216;height&#8217; inside it.</p>
<p>Funnily enough it&#8217;s been two years since I tried the original CSS3 accordion with the height issues and this will still only render in Webkit browsers so you&#8217;ll need <strong style="color:red;">Safari or Chrome</strong> to view it properly, it will come up in Firefox but without all the CSS3 fluff! This is an example of a menu full of links.</p>
<p><a href="http://development.tobypitman.com/css/css3accordian.html" class="viewdemo">Menu Demo</a></p>
<p>The next example is a text box accordian. This time instead of worrying about the container height I&#8217;ve targeted the paragraph tag. I&#8217;ve now put the &#8216;id&#8217; in the list item and used the decendant selector &#8216;>&#8217; to target all &#8216;p&#8217; tags inside that list item.</p>
<pre>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;ul class=&quot;menu&quot;&gt;<br />
&lt;li class=&quot;title&quot; id=&quot;1&quot;&gt;&lt;a href=&quot;#1&quot;&gt;&lt;span&gt;Stuff&lt;/span&gt;&lt;/a&gt;<br />
&nbsp; &nbsp; &lt;p&gt;Lorem ipsum dolor sit amet........&lt;/p&gt;<br />
&lt;/li&gt;<br />
<br />
&lt;li class=&quot;title&quot; id=&quot;2&quot; &gt;&lt;a href=&quot;#2&quot;&gt;&lt;span&gt;More Stuff&lt;/span&gt;&lt;/a&gt;<br />
&nbsp; &nbsp; &lt;p&gt;Lorem ipsum dolor sit amet.........&lt;/p&gt;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;p&gt;Lorem ipsum dolor sit amet..........&lt;/p&gt;<br />
&lt;/li&gt;<br />
&lt;/ul&gt;</div></div>
</pre>
<p>Here&#8217;s the CSS. The target parameters are padding, line-height and margin-bottom. The line-height and margin-bottom are doing all the work and the &#8216;p&#8217; tag is given <em>overflow:hidden;</em> to make it disappear.</p>
<pre>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.title</span> p <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; -webkit-transition<span style="color: #00AA00;">:</span> all .5s ease-in-out<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;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0em</span> <span style="color: #933;">20px</span> <span style="color: #933;">0em</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-1.9em</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;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>&nbsp; &nbsp; <br />
&nbsp;<span style="color: #00AA00;">&#125;</span><br />
&nbsp;<br />
<br />
<span style="color: #3333ff;">:target </span><span style="color: #00AA00;">&gt;</span> p <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;">.5em</span> <span style="color: #933;">20px</span> <span style="color: #933;">1em</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.2em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0em</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;">#070707</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
</pre>
<p>Here&#8217;s the demo. Even works with an image. Check the scource! This is totally fucked in Firefox as yet so don&#8217;t bother. </p>
<p><a href="http://development.tobypitman.com/css/css3accordiantext.html" class="viewdemo">Menu Demo</a></p>
<p>Sorry for the scrappy code but this was only an experiment (proof of concept) which works for now only in Webkit, as yet to my knowledge this is the only accordian that can generate dynamic heights for panels. And yes, it looks shit in IE8!! </p>
<p>Any thoughts or improvements welcome! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobypitman.com/dynamic-css3-animated-accordian-menu/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>On Holiday!</title>
		<link>http://www.tobypitman.com/on-holiday/</link>
		<comments>http://www.tobypitman.com/on-holiday/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 12:09:10 +0000</pubDate>
		<dc:creator>Toby</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.tobypitman.com/?p=287</guid>
		<description><![CDATA[I'm now offically on holiday! Been about 10 years since I took a proper one so it's well earned!]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m now offically on holiday! Been about 10 years since I took a proper one so it&#8217;s well earned!</p>
<p><a href="http://www.tobypitman.com/wp-content/uploads/2010/02/holiday.jpg"><img class="alignnone size-full wp-image-289" title="holiday" src="http://www.tobypitman.com/wp-content/uploads/2010/02/holiday.jpg" alt="holiday" width="590" height="289" /></a></p>
<p>No computers, no phone (I am taking it but won&#8217;t answer!). Back on 18th of March&#8230;.with a tan!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobypitman.com/on-holiday/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Link to &#8216;child pages&#8217; in Wordpress with &#8216;the_post_thumbnail&#8217;</title>
		<link>http://www.tobypitman.com/link-to-child-pages-in-wordpress-with-the_post_thumbnail/</link>
		<comments>http://www.tobypitman.com/link-to-child-pages-in-wordpress-with-the_post_thumbnail/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 18:56:53 +0000</pubDate>
		<dc:creator>Toby</dc:creator>
				<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.tobypitman.com/?p=248</guid>
		<description><![CDATA[I thought I'd share this with anybody who's interested. I'm currently developing a site based in Wordpress that has a lot of nested child pages.]]></description>
			<content:encoded><![CDATA[<p>I thought I&#8217;d share this with anybody who&#8217;s interested. I&#8217;m currently developing a site based in Wordpress that has a lot of nested child pages.</p>
<p>I&#8217;ve used the new &#8216;Post Thumbnail&#8217; feature in 2.9 to link to the child pages from the &#8216;Parent&#8217; page using the Post Thumbnail as an image link. The reason for this is the client no longer has to faff about with customs fields, which are confusing to non-web savvy users.</p>
<p>This might be useful for people building portfolio sites for artists.</p>
<p>The code I&#8217;d previously been dabbling with pulled in a custom field called &#8216;Imagelink&#8217; from all the child pages associated with the parent page providing an image link to that child page.</p>
<p>The code below uses &#8216;get_the_post_thumbnail()&#8217; so all the client has to do is upload an image using the new &#8216;Post Thumbnail&#8217; feature in every new page as the link image.</p>
<p><a href="http://www.tobypitman.com/wp-content/uploads/2009/12/ms-1.jpg"><img class="alignnone size-full wp-image-251" title="ms-1" src="http://www.tobypitman.com/wp-content/uploads/2009/12/ms-1.jpg" alt="ms-1" width="305" height="86" /></a></p>
<p>Insert it into a page template in wordpress called &#8216;childLinks&#8217; or something like that.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><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> <span style="color: #000088;">$pages</span> <span style="color: #339933;">=</span> get_pages<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'child_of='</span><span style="color: #339933;">.</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;sort_column=post_date&amp;sort_order=desc&amp;parent='</span><span style="color: #339933;">.</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <br />
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pages</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$page</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_content</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
&lt;div class=&quot;childPageLink&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_page_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'full'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&lt;/div&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>Pretty handy and more CMS like.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobypitman.com/link-to-child-pages-in-wordpress-with-the_post_thumbnail/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>IGF Bath 2009</title>
		<link>http://www.tobypitman.com/igf-bath-2009/</link>
		<comments>http://www.tobypitman.com/igf-bath-2009/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 11:16:28 +0000</pubDate>
		<dc:creator>Toby</dc:creator>
				<category><![CDATA[Guitar stuff]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.tobypitman.com/?p=238</guid>
		<description><![CDATA[Got back from my yearly stint at Bath Spa University teaching for the International Guitar Foundation. A good time was had by all as usual and great to see some old faces and catch up.]]></description>
			<content:encoded><![CDATA[<p>Been a while since any updates here, and I mean a while! Been busy in the studio and I&#8217;ll write about what I&#8217;ve been up to soon.</p>
<p>Got back from my yearly stint at Bath Spa University teaching for the International Guitar Foundation. A good time was had by all as usual and great to see some old faces and catch up.</p>
<p>Some great gigs were provided during the week by John Wheatcroft, Stanton Moore and old BIMM friend Guthrie Govan with the Fellowship. Here&#8217;s a couple of pics of the week. Looking forward to next time!</p>
<div id="attachment_239" class="wp-caption alignnone" style="width: 600px"><a href="http://www.tobypitman.com/wp-content/uploads/2009/08/theband.jpg"><img src="http://www.tobypitman.com/wp-content/uploads/2009/08/theband.jpg" alt="My class - Classic Rock!" title="theband" width="590" height="308" class="size-full wp-image-239" /></a><p class="wp-caption-text">My class - Classic Rock!</p></div>
<div id="attachment_240" class="wp-caption alignnone" style="width: 600px"><a href="http://www.tobypitman.com/wp-content/uploads/2009/08/curry.jpg"><img src="http://www.tobypitman.com/wp-content/uploads/2009/08/curry.jpg" alt="Tutors eating a well deserved curry!" title="curry" width="590" height="243" class="size-full wp-image-240" /></a><p class="wp-caption-text">Tutors eating a well deserved curry!</p></div>
<div id="attachment_241" class="wp-caption alignnone" style="width: 600px"><a href="http://www.tobypitman.com/wp-content/uploads/2009/08/guthrie.jpg"><img src="http://www.tobypitman.com/wp-content/uploads/2009/08/guthrie.jpg" alt="Guthrie and the Fellowship rip it up!" title="guthrie" width="590" height="446" class="size-full wp-image-241" /></a><p class="wp-caption-text">Guthrie and the Fellowship rip it up!</p></div>
<div id="attachment_242" class="wp-caption alignnone" style="width: 600px"><a href="http://www.tobypitman.com/wp-content/uploads/2009/08/thelads.jpg"><img src="http://www.tobypitman.com/wp-content/uploads/2009/08/thelads.jpg" alt="Jim Clarke, Guthrie Govan and Martin Goulding. Guitar heaven!" title="thelads" width="590" height="418" class="size-full wp-image-242" /></a><p class="wp-caption-text">Jim Clarke, Guthrie Govan and Martin Goulding. Guitar heaven!</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.tobypitman.com/igf-bath-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New tutorial on Audiotuts</title>
		<link>http://www.tobypitman.com/new-tutorial-on-audiotuts/</link>
		<comments>http://www.tobypitman.com/new-tutorial-on-audiotuts/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 22:40:12 +0000</pubDate>
		<dc:creator>Toby</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.tobypitman.com/?p=221</guid>
		<description><![CDATA[Just had another tutorial go up on <a href="http://audiotuts.com">audiotuts.com</a> about using Logics automation with MIDI hardware controllers. Go check it out if your into Logic.

In other news apart from being snowed on a lot I've been learning Adobe After Effects and making some promos for my secret web project.]]></description>
			<content:encoded><![CDATA[<p>Just had another tutorial go up on <a href="http://audiotuts.com/tutorials/mixing-mastering/using-quick-automation-access-in-logic-8/">audiotuts.com</a> about using Logics automation with MIDI hardware controllers. Go check it out if your into Logic.</p>
<p>In other news apart from being snowed on a lot I&#8217;ve been learning Adobe After Effects and making some promos for my secret web project. Making good progress with it but knowing Photoshop animation already has really helped. <a href="http://videocopilot.com">VideoCopilot.com</a> has been a real help learning After Effects and Andrew Kramer is a good coach.</p>
<p>Just got Stormdrum 2 for the studio rig and I&#8217;m loving it. The drum sounds are massive! Here&#8217;s a little orchestral demo I threw together while I was trying it out. It&#8217;s called Attack of the Dung Beetles as I couldn&#8217;t think of a better title! There&#8217;s a scary thought!</p>
<p>Till next time!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobypitman.com/new-tutorial-on-audiotuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.tobypitman.com/wp-content/uploads/2009/02/attack-of-the-dung-beetles.mp3" length="1101033" type="audio/mpeg" />
		</item>
		<item>
		<title>Logic tutorial on AUDIOTUTS.COM</title>
		<link>http://www.tobypitman.com/logic-tutorial-on-audiotutscom/</link>
		<comments>http://www.tobypitman.com/logic-tutorial-on-audiotutscom/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 17:45:17 +0000</pubDate>
		<dc:creator>Toby</dc:creator>
				<category><![CDATA[Logic Pro]]></category>

		<guid isPermaLink="false">http://www.tobypitman.com/?p=218</guid>
		<description><![CDATA[Happy new year all! Just had my Chord Memorizer tutorial accepted by the lovely people over at <a href="http://audiotuts.com">audiotuts.com</a>. Planning to do some more for them this year and have some really solid and fun ideas lined up already.]]></description>
			<content:encoded><![CDATA[<p>Happy new year all! Just had my Chord Memorizer tutorial accepted by the lovely people over at <a href="http://audiotuts.com">audiotuts.com</a>. It&#8217;s had some really positive feedback so far. I might do a follow up to it on this site soon. Planning to do some more for them this year and have some really solid and fun ideas lined up already.</p>
<p>As far as this year goes with this blog I&#8217;m planning to do loads more guitar tutorials. I have about three big topics I want to cover so they may come in a few parts each. You can expect a small tutorial pretty soon on some useful pentatonic ideas.</p>
<p>2008 was a bit of a strange one for me as far as guitar goes as I was doing quite a bit of web stuff but I&#8217;m going to be scaling that back and really getting back to some good old playing this year. I guess I&#8217;d just burnt out a bit on music but that seems to be over now and I&#8217;m starting to feel a lot more creative musically ( lot&#8217;s of tunes rattling round the noggin! ).</p>
<p>In fact the only web stuff I&#8217;m planning is the launch of a new site aimed directly at guitar players. Can&#8217;t say much at the moment but it&#8217;s going to be amazing. Most of the material is written and I&#8217;ll start building the site soon. I&#8217;m hoping it&#8217;s going to be a big hit in the world of guitar, so stay tuned!!</p>
<p>You can check out the Logic tutorial <a href="http://audiotuts.com/tutorials/composition/play-chords-with-one-finger-using-logic-pros-chord-memorizer/">here</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobypitman.com/logic-tutorial-on-audiotutscom/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

