<?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>Interaction Designer Craig Dennis &#187; Wordpress</title>
	<atom:link href="http://craigmdennis.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://craigmdennis.com</link>
	<description>The portfolio &#38; blog for Craig Dennis, an Interaction Designer based in South East England</description>
	<lastBuildDate>Thu, 09 Feb 2012 13:11:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>WordPress, TimThumb &amp; jQuery: Image Hover Effect</title>
		<link>http://craigmdennis.com/wordpress-timthumb-jquery-image-hover-effect/</link>
		<comments>http://craigmdennis.com/wordpress-timthumb-jquery-image-hover-effect/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 16:40:01 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Effect]]></category>
		<category><![CDATA[Greyscale Hover]]></category>
		<category><![CDATA[Hover]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[On-The-Fly Thumbnails]]></category>
		<category><![CDATA[Thumbnail Generation]]></category>
		<category><![CDATA[TimThumb]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://craigmdennis.com/?p=1986</guid>
		<description><![CDATA[This post is about using TimThumb to create an on-the-fly, greyscale image thumbnail of the first image in a post and use jQuery to fade in a colour version on top creating a nice effect. Let me also say that this is not in-depth and is not for beginners as I&#8217;m not going to walk... <a class="more" href="http://craigmdennis.com/wordpress-timthumb-jquery-image-hover-effect/">Read more &#8594;</a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-2104" title="wordpress" src="http://uploads.craigmdennis.com/2010/04/wordpress-420x370.jpg" alt="" width="420" height="370" /></p>
<p>This post is about using TimThumb to create an on-the-fly, greyscale image thumbnail of the first image in a post and use jQuery to fade in a colour version on top creating a nice effect.</p>
<p>Let me also say that this is not in-depth and is not for beginners as I&#8217;m not going to walk you through each step, merely give you an overview.</p>
<p>If you want to see a demo then look at my <a href="http://craigmdennis.com/articles/">homepage</a> as I&#8217;ve used this effect there and on my search &amp; post lists. As the thumbnails are created on-the-fly and not during image upload, you can use this technique anywhere you like! Why there isn&#8217;t a plugin for this I don&#8217;t know.</p>
<p>Things you will need:</p>
<ol>
<li>TimThumb.php</li>
<li><a href="http://www.pixellica.com/web/free-wordpress-script-for-custom-post-images#more-837" target="_blank">Get the Image script</a> (includes a TimThumb.php in a package file)</li>
<li>jQuery</li>
<li>WordPress</li>
</ol>
<p>Put TimThumb.php in your theme folder in /scripts/ (create this folder if it doesn&#8217;t exist)</p>
<p>Follow <a href="http://www.pixellica.com/web/free-wordpress-script-for-custom-post-images#more-837" target="_blank">this</a> tutorial to get TimThumb and Get The Image working in wordpress. It&#8217;s as simple as copying the script to your functions.php file (or create one if you don&#8217;t have one).</p>
<p>Link to jQuery (there is a way to link to the jQuery library that comes with WordPress but I prefer to link to the one hosted on Google)</p>
<p><strong>To view all the code, simply hover over it.</strong></p>
<h3><strong>Link to jQuery</strong></h3>
<p>Add the following to your header template to link to the Google Code hosted jQuery library:</p>
<pre>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js" type="text/javascript"&gt;&lt;/script&gt;</pre>
<h3><strong>The PHP</strong></h3>
<p>This goes in your template file</p>
<pre style="font: normal normal normal 12px/18px Consolas, Monaco, 'Courier New', Courier, monospace;">
<div id="_mcePaste">&lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;</div>
<div id="_mcePaste" style="padding-left: 30px;">&lt;div class="home-thumb"&gt;</div>
<div id="_mcePaste" style="padding-left: 60px;">&lt;a class="post-thumb-a" href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php echo get_image(150, 306, '2'); ?&gt;&lt;/a&gt;</div>
<div id="_mcePaste" style="padding-left: 60px;">&lt;a class="post-thumb-b" href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php echo get_image(150,306,''); ?&gt;&lt;/a&gt;</div>
<div id="_mcePaste" style="padding-left: 30px;">&lt;/div&gt;</div>
<div id="_mcePaste">&lt;?php endwhile; endif; ?&gt;</div>
</pre>
<p>This should be generally familiar to WordPress people but it&#8217;s saying if there are posts, while there are posts, get the information within the post. More information can be found on the <a href="http://codex.wordpress.org/The_Loop" target="_blank">WordPress Codex about The Loop</a>. The permalink links to the url of the post (can be any link destination though) and inside the link we call the function you should have pasted into your functions file &#8211; get_image(). The arguments are &#8216;height&#8217;, &#8216;width&#8217; and &#8216;filter&#8217;. I have yet to find a list of all the filters supported by TimThumb but for this you&#8217;ll only need filter 2 &#8211; greyscale.</p>
<p>So get_image()  gets the first image in the post and crops it to the dimensions inside the callback (in this case a height of 150px and a width of 306px but you can choose any size that is smaller than the image in the post). The third number is calling a filter from TimThumb which creates a greyscale thumbnail of the image. Then we duplicate this call but remove the &#8217;2&#8242; so we get the full colour thumbnail. We do this so that we can position them one on top of the other and fade one in creating a cool transtion.</p>
<p>The class &#8216;.post-thumb-a&#8217; should be on the link containg the greyscale image &amp; the class &#8216;.post-thumb-b&#8217; goes on the link containing the colour image. This is important as &#8216;.post-thumb-a&#8217; will be placed on top to hide the colour image and will be faded out to reveal the colour image.</p>
<h3>The CSS</h3>
<p>This positions the images and title correctly</p>
<pre>.home-thumb {

<span style="white-space: pre;">	</span>overflow:hidden;

<span style="white-space: pre;">	</span>position:relative;

<span style="white-space: pre;">	</span>width:306px;

<span style="white-space: pre;">	</span>height:150px;

}

a.post-thumb-a img, a.post-thumb-b img {

<span style="white-space: pre;">	</span>position:absolute;<span style="white-space: pre;">	</span>

<span style="white-space: pre;">	</span>top:0;

<span style="white-space: pre;">	</span>left:0;

}

a.post-thumb-a img {

<span style="white-space: pre;">	</span>z-index:10;

}</pre>
<p>What the CSS does is position &#8216;post-thumb-a img&#8217; (the image inside the link) on top (z-index:10;) of post-thumb-b img. This needs to be inside a div as it uses an absolute position to make sure they are pixel perfect overlayed. Make the parent div the same height and width as the thumbnail size you specified in the get_image() callback above.</p>
<p>If you test this now, you should see the greyscale image and not the coloured on &#8212; that&#8217;s because they coloured one is hidden underneath.</p>
<h3>The Javascript</h3>
<p>This goes in the header.php template of your WordPress theme</p>
<pre>&lt;script type="text/javascript"&gt;

jQuery(document).ready(function($){

<span style="white-space: pre;">	</span>$(".home-thumb a img").hover(

<span style="white-space: pre;">		</span>function() {

<span style="white-space: pre;">			</span>$(this).stop().animate({"opacity": "0"}, 800);

<span style="white-space: pre;">			</span>},

<span style="white-space: pre;">		</span>function() {

<span style="white-space: pre;">			</span>$(this).stop().animate({"opacity": "1"}, 800);

<span style="white-space: pre;">			</span>});

});

&lt;/script&gt;</pre>
<p>The Javascript selects &#8216;.home-thumb-a img&#8217; (the greyscale image within the link, the one hiding the coloured image) and sets the opacity to &#8217;1&#8242; until the mouse hovers over it, then change the opacity to &#8217;0&#8242; over the time of 800 ms (1000 ms = 1 second) to reveal the colour image, creating a colour fading effect.</p>
<p>That&#8217;s it, you&#8217;re done. Now have a play around. I&#8217;ve added a title tag in mine.</p>
<p>If I&#8217;ve made a mistake anywhere here please let me know and I&#8217;ll make sure to change it. Any questions and I&#8217;ll be glad to help.</p>
]]></content:encoded>
			<wfw:commentRss>http://craigmdennis.com/wordpress-timthumb-jquery-image-hover-effect/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>CSS, Troubles &amp; More</title>
		<link>http://craigmdennis.com/css-troubles-more/</link>
		<comments>http://craigmdennis.com/css-troubles-more/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 23:36:56 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTTP Error]]></category>
		<category><![CDATA[Loud Music]]></category>
		<category><![CDATA[Margins]]></category>
		<category><![CDATA[Padding]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[Strongly Worded Letter]]></category>
		<category><![CDATA[Visual Editor]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://craigmdennis.com/?p=1236</guid>
		<description><![CDATA[With New Designers coming up rapidly there has been much fretting about who is doing what and who is designing what. With myself and a few others being on an internship at Samsung it has proved hard to keep things consistent. After much arguing through many emails I have decided to defer my vote to... <a class="more" href="http://craigmdennis.com/css-troubles-more/">Read more &#8594;</a>]]></description>
			<content:encoded><![CDATA[<p>With New Designers coming up rapidly there has been much fretting about who is doing what and who is designing what. With myself and a few others being on an internship at Samsung it has proved hard to keep things consistent.</p>
<p>After much arguing through many emails I have decided to defer my vote to someone else as it&#8217;s getting heated. Just need someone to make a creative decision who is higher up in the hierarchy than we are.</p>
<p>Forgetting all of that stuff, I have redesigned my website, business card and all pdf documents and updated my &#8216;brand&#8217; since doing that for the final degree exhibition. I changed the colour to 100% Magenta instead of orange but kept the same font The portfolio section is now up with proper descriptions, pictures and styling (with some more projects to come when I get a chance).</p>
<p>My business card can be seen below and yes I am aware that the back of the card has the wrong corners rounded in the image.</p>
<p><a href="http://uploads.craigmdennis.com/2009/07/2009-07-02_BusinessCard.jpg"><img class="alignnone size-full wp-image-1239" title="Busniness Card" src="http://uploads.craigmdennis.com/2009/07/2009-07-02_BusinessCard.jpg" alt="Busniness Card" width="356" height="356" /></a></p>
<p>While at Samsung I noticed that my new website design did not look correct in IE6 (no surprise there then) so I spent some time correcting some CSS problems. No sooner than I had done that than I tried it in Safari and it failed even more to display correctly.<span id="more-1236"></span></p>
<p>After several hours trying to figure out what the problem was, changing (and improving) my CSS stylesheet I discovered that even though I zero&#8217;d all margins at the start of the CSS by:</p>
<pre>* {margin:0px; padding:0px}</pre>
<p>Safari is a bitch and does not recognise that. So after several hours of trying, finally declaring the padding and margins as 0 for ul and li elements as well as entire divs, the formatting magically came into alignment in Safari.</p>
<p>After doing all that, feeling like I needed to vent some of my frustration and being British I wanted to write a strongly worded letter to Mr. Jobs. Instead I am blogging about it. This in itself proved more difficult than first anticipated as when I logged into Worpress, the visual text editor for the post screen had gone and all the text was coming out in white! After a quick Google and a re-install of WordPress 2.8 the editor came back and I can see what I&#8217;m writing now.</p>
<p>I have just received an HTTP error while uploading my business card image. Seriously what is going on with the internet tonight?</p>
<p>Now the reason I am blogging at this late hour and not in bed, asleep in preparation for work tomorrow is simple&#8230; There are people in my house who I don&#8217;t know, playing very loud music. I hope tomorrow is a better day.</p>
]]></content:encoded>
			<wfw:commentRss>http://craigmdennis.com/css-troubles-more/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress 2.7 Beta 1</title>
		<link>http://craigmdennis.com/wordpress-27-beta-1/</link>
		<comments>http://craigmdennis.com/wordpress-27-beta-1/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 12:22:07 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[News and Rumours]]></category>
		<category><![CDATA[Beta]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://craigmdennis.com/?p=845</guid>
		<description><![CDATA[I just downloaded and played around with the latest WordPress beta release which has had a face lift. You are right in thinking this is a bit odd considering that normally the number before the dot changes when a major release is, well, released but not in this case. It may very well be that... <a class="more" href="http://craigmdennis.com/wordpress-27-beta-1/">Read more &#8594;</a>]]></description>
			<content:encoded><![CDATA[<p>I just downloaded and played around with the <a href="http://wordpress.org/development/2008/11/wordpress-27-beta-1/" target="_blank">latest WordPress beta release</a> which has had a face lift. You are right in thinking this is a bit odd considering that normally the number before the dot changes when a major release is, well, released but not in this case. It may very well be that WordPress will release the final incarnation with the &#8216;WORDPRESS 3&#8242; title and if I&#8217;m honest it is very much deserved.</p>
<p><a href="http://uploads.craigmdennis.com/2008/11/rightfull.jpg"><img class="alignnone size-full wp-image-849" title="rightfull" src="http://uploads.craigmdennis.com/2008/11/rightfull.jpg" alt="" width="296" height="570" /></a></p>
<p>&nbsp;</p>
<p>The interface has been reorganised but does seem a little crammed in on the admin page, other than that though I really like the way everything has been set out with the menu on the left. The other change is that all post contextual elements are on the right, so categories, date and time, security and save functions. As they are located in a different place, it took me a while to find them but this is probably just because I am used to the older version. All in all I think the next release will have a much more corporate feel to it and add some much better organisation. Only time will tell if the blogging community accept it. For no though, I am happy with the current version (even though I can&#8217;t get the flash uploader to work, but thats a different story).</p>
]]></content:encoded>
			<wfw:commentRss>http://craigmdennis.com/wordpress-27-beta-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Blog</title>
		<link>http://craigmdennis.com/new-blog/</link>
		<comments>http://craigmdennis.com/new-blog/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 02:18:14 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://craigmdennis.com/?p=3</guid>
		<description><![CDATA[Hello World! This is a very apt phrase at the moment as I have been learning php and the first thing it was used for is to echo &#8220;Hello World!&#8221;. It is also appropriate as I have managed (after much tweaking) to use WordPress and my own domain to host my own blog&#8230; so to... <a class="more" href="http://craigmdennis.com/new-blog/">Read more &#8594;</a>]]></description>
			<content:encoded><![CDATA[<p>Hello World!</p>
<p>This is a very apt phrase at the moment as I have been learning php and the first thing it was used for is to echo &#8220;Hello World!&#8221;. It is also appropriate as I have managed (after much tweaking) to use WordPress and my own domain to host my own blog&#8230; so to anyone who is reading this &#8211; Please see above!</p>
]]></content:encoded>
			<wfw:commentRss>http://craigmdennis.com/new-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: craigmdennis.com @ 2012-02-10 13:48:53 by W3 Total Cache -->
