<?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>jc-designs.net</title>
	<atom:link href="http://jc-designs.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://jc-designs.net/blog</link>
	<description>jc-designs blog</description>
	<lastBuildDate>Fri, 30 Jul 2010 20:52:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to slice up a PSD file in Photoshop</title>
		<link>http://jc-designs.net/blog/2010/07/how-to-slice-up-a-psd-file-in-photoshop/</link>
		<comments>http://jc-designs.net/blog/2010/07/how-to-slice-up-a-psd-file-in-photoshop/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 03:47:55 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[Photoshop]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=459</guid>
		<description><![CDATA[
			
				
			
		
Because its quick
I am jumping around in topics lately from CSS, to jQuery, to WordPress, to blogging, and now onto Photoshop. This is good though. Something different every day. Yesterday I had the pleasure of helping out someone who wants to learn how to create a websites. After the the short lesson I gave him, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fhow-to-slice-up-a-psd-file-in-photoshop%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fhow-to-slice-up-a-psd-file-in-photoshop%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<h3>Because its quick</h3>
<p>I am jumping around in topics lately from CSS, to jQuery, to WordPress, to blogging, and now onto Photoshop. This is good though. Something different every day. Yesterday I had the pleasure of helping out someone who wants to learn how to create a websites. After the the short lesson I gave him, he said &#8220;Wow&#8230;I have a lot to learn.&#8221; To which I replied with a simple yes. He had coded a page, and then had me look at it. At which point I broke him of some nasty habits. This bit of teaching had me thinking though. What are some things I see some people do that makes me shake my head, when I know there is an easier way. </p>
<p>The first thing that popped into my brain was watching someone use the eraser tool in Photoshop to take away the background around an image of a person. That is just plain crazy. But there was a second item I thought about just after that nonsense. Slicing up a Photoshop PSD file to be used as a web page. I know people who do things differently, like using guides and then cropping the images necessary. That takes a while, even though I know one guy who is pretty damn quick at it. For me though, slicing is the way to go. It&#8217;s quick, easy, and if you need to make a change, there is no cropping involved &#8211; just a re-save.</p>
<p><span id="more-459"></span></p>
<h3>Let&#8217;s cut some stuff up!</h3>
<p>First, let&#8217;s start out with a template I am building for a personal project of mine. You can see what it will look like with some content thrown in. Standard stuff&#8230;logo, header, nav, left column for content, sidebar for some links, and a footer.</p>
<div class="center">
<img src="http://www.jc-designs.net/newimages/blogImages/helix1.jpg" alt="Template image" />
</div>
<p><img src="http://www.jc-designs.net/newimages/blogImages/helix2.jpg" alt="Slice tool in Photoshop" class="right" />Before you do any slicing though, you need to hide all the content crap, because you don&#8217;t want that being part of the image. After you have hidden all that stuff, you will want to save the file but with a different name, or like I do and put _sliced at the end of it. Once you have done all that, you need to grab the slice tool, which you can see highlighted in the image to the right (looks like an exacto knife). If you don&#8217;t see it in your tool bar, it is hidden behind the crop tool.</p>
<p>Now for the actual slicing. Imagine you took a pair of scissors and cut the sections out that you needed. Piece of cake! Click on the slice tool, and start dragging across the psd file. In the image below, I started from the top left corner, and dragged down to the beginning of the the navigation section on the far right. I left go of the mouse button, clicked immediately, and dragged to the left side to the top of the content section. Then I repeated doing that until I had what you see below (in order to save this as a single image this does not show the actual slice lines- just red lines where they would be).</p>
<div class="center">
<img src="http://www.jc-designs.net/newimages/blogImages/helix3.jpg" alt="Sliced psd file" />
</div>
<h3>That&#8217;s great&#8230;but what do I do with it now?</h3>
<p>I&#8217;ll explain the numbers in a bit, and then I&#8217;ll show you what the html would look like. But first, you have to save it for the web. I am going to assume you at least know how to do that, because it would take a silly amount of time to explain. With a sliced image, when you Save for Web, you select the type you want, jpg in this case, and then browse to where your images folder is, but don&#8217;t select it. You don&#8217;t actually want to be in the images folder otherwise it will create another images folder within it. When you save a sliced image like this, it is going to save multiple images. You then choose a name that you want to save them as (I usually choose a name like &#8216;index&#8217; because I can remember what image goes where that way). This is what makes slicing so fast and easy.</p>
<p>The beauty is, if you have to go back and make a change to the psd file, you go and do it, and resave as the name you chose. In my example here, I would have 6 images after I saved &#8211; index_01.jpg, index_02.jpg&#8230;all the way to 06.</p>
<h3>The HTML</h3>
<p>Before I explain the numbers, lets take a look at what the HTML might look like:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;color: #439AD0; font-weight: bold;">&lt;div id=&quot;container&quot;&gt;
&lt;div id=&quot;header&quot;&gt;
&lt;div id=&quot;logo&quot;&gt;&lt;!--logo html goes here --&gt;&lt;/div&gt;
&lt;h1&gt;Your Heading Goes Here&lt;/h1&gt;
&lt;/div&gt;
&lt;div id=&quot;navigation&quot;&gt;&lt;!--nav html goes here --&gt;&lt;/div&gt;
&lt;div id=&quot;contentRepeat&quot;&gt;
&lt;div id=&quot;contentBottom&quot;&gt;
&lt;div id=&quot;contentTop&quot;&gt;
&lt;!-- content html goes here - main content, and sidebar divs --&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;footer&quot;&gt;&lt;!--footer html goes here --&gt;&lt;/div&gt;
&lt;/div&gt;</pre></div></div>

<h3>NOW let&#8217;s talk about the numbers</h3>
<p>So I now have 6 images and the basic HTML. Now what? Now the fun part. All of the CSS, which I won&#8217;t go through, but give you the gist of it. It would be a very long post if I types all that out, and the point of this isn&#8217;t the actual CSS, but how to do the slicing, and what to do with it.</p>
<p>Your basic CSS for the divs would be:</p>
<ul>
<li>header: background image using #1 (index_01.jpg),and no-repeat</li>
<li>navigation: background image using #2(index_02.jpg), and no-repeat</li>
<li>contentRpeat: background image using #4 (index_04.jpg), and repeat-y</li>
<li>contentBottom: background image using #5 (index_05.jpg), no-repeat and a position of left bottom</li>
<li>contentTop: background image using #3 (index_03.jpg), no-repeat and a position of left top, with a min height value of what ever the height is of index_03.jpg</li>
</ul>
<p>The #6 image (index_06) is never used since it is just a solid color, so you can toss it in the trash.</p>
<h3>Any final words?</h3>
<p>Slices are awesome in that it is easy to make a change to the PSD file, and re-save, without having to re-crop everything. You can cut the image up into as many pieces as you want, just be sure to zoom in and double check all of your slice lines are touching&#8230;not overlapping or too short by a pixel. Otherwise you will end up with an additional image and things will look messed up when you lay it out. Once you get the hang of slicing, going from Photoshop to web page becomes a breeze.</p>
<p>Do you use slicing already? Or are you a guide and crop type person? Maybe you have a completely other method I am not familiar with? Comment and let me know!</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=459" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/07/how-to-slice-up-a-psd-file-in-photoshop/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Got published on Onextrapixel.com!</title>
		<link>http://jc-designs.net/blog/2010/07/got-published-on-onextrapixel-com/</link>
		<comments>http://jc-designs.net/blog/2010/07/got-published-on-onextrapixel-com/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 14:46:53 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=456</guid>
		<description><![CDATA[
			
				
			
		
Yes I am freakin&#8217; excited. Please check out my article at onextrapixel.com, called &#8216;The Real World Development vs The Optimum Way&#8216; and let me know what you think! There or here, I don&#8217;t care!
Oh ya, and I hit 200 subscribers!
 ]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fgot-published-on-onextrapixel-com%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fgot-published-on-onextrapixel-com%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Yes I am freakin&#8217; excited. Please check out my article at onextrapixel.com, called &#8216;<a href="http://www.onextrapixel.com/2010/07/28/the-real-world-development-vs-the-optimum-way/">The Real World Development vs The Optimum Way</a>&#8216; and let me know what you think! There or here, I don&#8217;t care!</p>
<p>Oh ya, and I hit 200 subscribers!</p>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=456" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/07/got-published-on-onextrapixel-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting border-radius to work in IE</title>
		<link>http://jc-designs.net/blog/2010/07/getting-border-radius-to-work-in-ie/</link>
		<comments>http://jc-designs.net/blog/2010/07/getting-border-radius-to-work-in-ie/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 07:37:02 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=450</guid>
		<description><![CDATA[
			
				
			
		
Border-radius on IE? That is just crazy!
It&#8217;s funny how many things from my job come up as posts. Well, I guess not funny, because I end up working on things that I am not familiar with and have to fix. Which is the case tonight. I&#8217;m not sure if you have read any articles, but [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fgetting-border-radius-to-work-in-ie%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fgetting-border-radius-to-work-in-ie%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<h3>Border-radius on IE? That is just crazy!</h3>
<p>It&#8217;s funny how many things from my job come up as posts. Well, I guess not funny, because I end up working on things that I am not familiar with and have to fix. Which is the case tonight. I&#8217;m not sure if you have read any articles, but there are plenty, about getting the CSS3 property border-radius to work in IE. It is actually rather easy, so let&#8217;s get to it, and I&#8217;ll show you how!<br />
Actually, I&#8217;ll tell you how. And then I&#8217;ll tell you some of the troubles I ran into.</p>
<h3>Wait, that&#8217;s it?</h3>
<p>So getting your rounded corners is pretty damn easy. There are three things you have to do:</p>
<p>1) Go <a href="http://www.htmlremix.com/css/curved-corner-border-radius-cross-browser">here</a> and download the htc file.<br />
2) Place the downloaded file in your images folder<br />
3) In your CSS file, on the style that you want the rounded corners you add something like this:</p>
<p><span id="more-450"></span></p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #6666ff;color: #439AD0;">.roundedClass</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
-moz-border-radius<span style="color: #00AA00;color: #439AD0;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;color: #439AD0;">;</span>
-webkit-border-radius<span style="color: #00AA00;color: #439AD0;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;color: #439AD0;">;</span>
behavior<span style="color: #00AA00;color: #439AD0;">:</span><span style="color: #993333;color: #439AD0;">url</span><span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/border-radius.htc</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>This being the important part:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;">behavior<span style="color: #00AA00;color: #439AD0;">:</span><span style="color: #993333;color: #439AD0;">url</span><span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/border-radius.htc</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span></pre></div></div>

<p>Where ever you are using the border-radius properties, you want the behavior added as well. Note that this does not work at all on anything in a form. So inputs, buttons, whatever&#8230;if it is in a form, I could not get this damn thing to work. Also, make the path in the behavior line relative to the document NOT the CSS file. Got it? If for instance, the .htc file is in the images folder and you are dealing with a root level document, then it would be images/border-radius.htc. If you have any questions about this, post a question in the comments section.</p>
<h3>IE8 is not very nice &#8211; pay attention here!</h3>
<p>I learned something while doing this. IE8.0.6 and IE8.0.76 handle this differently. First, the element with this property on it should be positioned to relative. If you have text on top of it, then that will have to be wrapped in something and also positioned relative. Example:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;color: #439AD0; font-weight: bold;">&lt;div class=&quot;roundedClass&quot;&gt;&lt;p class=&quot;textClass&quot;&gt;This is the text that goes on top of the rounded corners div&lt;/p&gt;&lt;/div&gt;</pre></div></div>

<p>If you did this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;color: #439AD0; font-weight: bold;">&lt;div class=&quot;roundedClass&quot;&gt;This is the text that goes on top of the rounded corners div&lt;/div&gt;</pre></div></div>

<p>Then IE8.0.76 doesn&#8217;t play nice. IE8.06 however will work fine. I have NO idea why, but that is how it is.</p>
<h3>To conclude</h3>
<p>Have two wrappers (elements)&#8230;both positioned relative, the outer has the behavior and border-radius properties. Piece of cake. This works in IE6-8, and once I figured out the two wrappers and position relative thing, everything worked beautifully. Again, if you are still confused, ask away!</p>
<p>I will leave you with a quick tip. If you have multiple tabs open in IE8, press ctrl+q. It will show all the tabs you have open in one window, which you can then pick the one you want to view. Works kind of like Apple&#8217;s Expose. I wish I had known that a while back. It is actually a feature that they should have been promoting more. Especially considering that FF4 will have this feature now as well.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>.detach();</strong><br />
This method will remove the matched elements from the DOM. Works kind of like .remove(), only that it keeps all the data associated with the removed elements in case you want to reinsert them back in later. So below would remove the unordered list from the element with an id of &#8216;wrapper&#8217;.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#wrapper'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">detach</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'ul'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=450" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/07/getting-border-radius-to-work-in-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Could Social Media have its own crash like .com?</title>
		<link>http://jc-designs.net/blog/2010/07/could-social-media-have-its-own-crash-like-com/</link>
		<comments>http://jc-designs.net/blog/2010/07/could-social-media-have-its-own-crash-like-com/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 03:59:34 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[social media]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=442</guid>
		<description><![CDATA[
			
				
			
		
Brilliant idea&#8230;I wish I thought of it
Today, while commenting on the blog Do It By Hand, I clicked on another commenter&#8217;s link. It was mainly out of curiosity, but what it brought me to, and I can only believe that it is the actual commenter&#8217;s upcoming business, made my jaw drop. What could be so [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fcould-social-media-have-its-own-crash-like-com%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fcould-social-media-have-its-own-crash-like-com%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<h3>Brilliant idea&#8230;I wish I thought of it</h3>
<p>Today, while commenting on the blog <a href="http://www.mcculloughdesigns.com/blog/bad-blog-comments/1003/">Do It By Hand</a>, I clicked on another commenter&#8217;s link. It was mainly out of curiosity, but what it brought me to, and I can only believe that it is the actual commenter&#8217;s upcoming business, made my jaw drop. What could be so damn surprising that you were actually stunned by seeing it, you ask? Take a look at this, and then think for a minute before reading on.</p>
<div class="center">
<img src="http://www.jc-designs.net/newimages/blogImages/cFlock.jpg" alt="CommentFlock image" />
</div>
<p><span id="more-442"></span></p>
<h3>If you build it, they will come</h3>
<p>Right now you are probably thinking something along the lines of what I was. That is incredibly stupid. Who would pay a company to have people go to your blog and comment on it? Think really hard about that, because I have experience in seeing people pay for some incredibly stupid stuff, like setting up social media accounts. Why would they pay for that? They don&#8217;t have time, they don&#8217;t understand how or what it really is but they know they want it, or maybe they are not internet savy enough. Who knows, but the point is people do.</p>
<p>Now think about this service that <a href="http://commentflock.com/">CommentFlock</a> is offering. Say you are a new blogger, and you don&#8217;t have the patience it takes to build a readership following. You want people to come to your blog and think you are writing something terribly important. &#8220;This blog must be awesome, look at all the comments each post has!&#8221; That is what you would want anyone visiting your blog to think. How do you do this quickly? You pay these guys, who pays other people to go and comment on your blog. They say on that page that up to 20 different commenters will come to your blog and post something up, and interact with the conversation taking place with the &#8216;real&#8217; visitors.</p>
<p>As much as I hate the idea of what this guy/company is going to be doing, I see the potential because I know people will pay for it. All they need to think is that it will drive people to their site, and they will fork over the cash. It&#8217;s brilliant. Of course this made me think of something else.</p>
<h3>Could there be a Social Media crash?</h3>
<p>All of the above was just to get you thinking about what I&#8217;m going to write about next. Could this kind of thing lead to a Social Media crash? Not as drastic as the .com, but still influential. Think of all the social media sites that keep popping up out of no where. I swear I read about a new one every day. Then think of all the other sites that might try to cash in on the success of them. Advertisers, CommentFlock type companies, whatever. Think of all the tweets you get that are just retweets of other tweets. Some new article comes out on one of the major design/developer blogs, I get about 5 tweets from different people about it, and I am not following more than like 20 people. Then you go to a blog that is crammed full of robot like comments sent from CommentFlock. More companies start doing the same thing, and soon you might have robot comments actually talking to other non-real comments. Soon, you can&#8217;t tell what comment is pure crap, and which is real.</p>
<p>I know you are thinking that is all far fectched, but all the automatic stuff being sent by twitter, be it advertising, retweets, or randomly generated stuff, then these fluff comments, and who the hell knows what else could be coming, will all start to add up to a TON of useless info. I am beginning to wonder if there is a threshold for the amount of crap data being sent by all of these different social media sites that people are willing to take.</p>
<h3>Just asking you to think about it</h3>
<p>My point isn&#8217;t really about the comment company. It&#8217;s about all the useless stuff being sent through it. I love twitter, but I wish I could filter out tweets that are duplicates. I love reading blog comments (I like getting them too!). What if though, companies start taking advantage of social media in a way that it becomes so annoying. Will people drop off those services because they are getting more crap than good out of it? What about the companies that rely on the actual social media services themselves to make money if people did say screw it? Obviously there is no danger right now of something like that happening, but what about 5 years down the road when social media isn&#8217;t so new?</p>
<p>Just something I pondered today. Thoughts?</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=442" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/07/could-social-media-have-its-own-crash-like-com/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Wordpress Custom Fields, plus Compass/Sass tip: CSS inline images</title>
		<link>http://jc-designs.net/blog/2010/07/wordpress-custom-fields-plus-compasssass-tip-css-inline-images/</link>
		<comments>http://jc-designs.net/blog/2010/07/wordpress-custom-fields-plus-compasssass-tip-css-inline-images/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 03:56:43 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[Sass/Less/Compass]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Compass]]></category>
		<category><![CDATA[sass]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=435</guid>
		<description><![CDATA[
			
				
			
		
Set out to learn something&#8230;and I did. Now its your turn
I wanted to create images that I could use for each post showing that it belonged to a certain type of category. You look at the image, and without reading the title, you would say &#8220;Oh, this post relates to Wordpress.&#8221; Same with jQuery, Blogging [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fwordpress-custom-fields-plus-compasssass-tip-css-inline-images%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fwordpress-custom-fields-plus-compasssass-tip-css-inline-images%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<h3>Set out to learn something&#8230;and I did. Now its your turn</h3>
<p>I wanted to create images that I could use for each post showing that it belonged to a certain type of category. You look at the image, and without reading the title, you would say &#8220;Oh, this post relates to Wordpress.&#8221; Same with jQuery, Blogging in general, or whatever category I come up with. Something my readers would come to recognize over time. I also wanted to be able to do it without having to stick it in manually in the post like I do with the other images I stick in articles. If you are on the home page you will already see this. That is the one I came up with for articles relating to Wordpress.</p>
<p>Now, I can&#8217;t take credit for what I am about to show you. I learned how to do this from<a href="http://justintadlock.com/archives/2007/10/27/wordpress-custom-fields-adding-images-to-posts">Justin Tadlock&#8217;s blog</a>, but I wanted to spread the love. This was the best tutorial I found on the subject.</p>
<h3>Just 10 Easy Steps!</h3>
<p>Here is my quick and dirty paraphrasing of it. Meaning, do EXACTLY AS IT SAYS BELOW.</p>
<p><span id="more-435"></span><br />
1) Create awesome post.<br />
2) Scroll down in post editor, under Custom Fields,  create a Key named “Thumbnail.”<br />
3) The Value should be the url to the image: (Example: wp-content/themes/yourThemeName/images/imageName.jpg)</p>
<p>NOTE: It took me a while to understand where it was pulling the images from &#8211; images folder in your theme. I was trying to get it to load from somewhere outside the theme. I&#8217;m sure you can, but this was easier.</p>
<p>4) Click Add Custom Field. Ya! Part 1 is done.<br />
5) Add another, by clicking Enter New. This time make the Key be Thumbnail Class<br />
6) Make the Value thumbnail-class<br />
7) Open the template you want the image to show on (index.php, single.php, category.php, archive.php, etc.)<br />
8- Find this code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #b1b100;color: #439AD0;">if</span><span style="color: #009900;color: #439AD0;">&#40;</span>have_posts<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #339933;color: #439AD0;">:</span> <span style="color: #b1b100;color: #439AD0;">while</span><span style="color: #009900;color: #439AD0;">&#40;</span>have_posts<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #339933;color: #439AD0;">:</span> the_post<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

<p>Post the following code directly AFTER it:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #000088;">$thumb</span> <span style="color: #339933;color: #439AD0;">=</span> get_post_meta<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;color: #439AD0;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #0000ff;">'Thumbnail'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #000088;">$single</span> <span style="color: #339933;color: #439AD0;">=</span> <span style="color: #009900; font-weight: bold;color: #439AD0;">true</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
<span style="color: #000088;">$thumb_class</span> <span style="color: #339933;color: #439AD0;">=</span> get_post_meta<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;color: #439AD0;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #0000ff;">'Thumbnail Class'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #000088;">$single</span> <span style="color: #339933;color: #439AD0;">=</span> <span style="color: #009900; font-weight: bold;color: #439AD0;">true</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
<span style="color: #000088;">$thumb_alt</span> <span style="color: #339933;color: #439AD0;">=</span> get_post_meta<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;color: #439AD0;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #0000ff;">'Thumbnail Alt'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #000088;">$single</span> <span style="color: #339933;color: #439AD0;">=</span> <span style="color: #009900; font-weight: bold;color: #439AD0;">true</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

<p>9) Find this code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> the_content<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>  <span style="color: #000000; font-weight: bold;">?&gt;</span>
//OR THIS CODE, EITHER ONE
<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> the_excerpt<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>  <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>And add this code BEFORE it:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> <span style="color: #666666; font-style: italic;color: #439AD0;">// if there's a thumbnail</span>
<span style="color: #b1b100;color: #439AD0;">if</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000088;">$thumb</span> <span style="color: #339933;color: #439AD0;">!==</span> <span style="color: #0000ff;">''</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	<span style="color: #339933;color: #439AD0;">&lt;</span>img src<span style="color: #339933;color: #439AD0;">=</span><span style="color: #0000ff;color: #439AD0;">&quot;&lt;?php echo <span style="color: #006699; font-weight: bold;">$thumb</span>; ?&gt;&quot;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">class</span><span style="color: #339933;color: #439AD0;">=</span><span style="color: #0000ff;color: #439AD0;">&quot;&lt;?php if(<span style="color: #006699; font-weight: bold;">$thumb_class</span> !== '') { echo <span style="color: #006699; font-weight: bold;">$thumb_class</span>; } else { echo &quot;</span>left<span style="color: #0000ff;color: #439AD0;">&quot;; } ?&gt;&quot;</span>
	alt<span style="color: #339933;color: #439AD0;">=</span><span style="color: #0000ff;color: #439AD0;">&quot;&lt;?php if(<span style="color: #006699; font-weight: bold;">$thumb_alt</span> !== '') { echo <span style="color: #006699; font-weight: bold;">$thumb_alt</span>; } else { echo the_title(); } ?&gt;&quot;</span>
	<span style="color: #339933;color: #439AD0;">/&gt;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> <span style="color: #009900;color: #439AD0;">&#125;</span> <span style="color: #666666; font-style: italic;color: #439AD0;">// end if statement</span>
<span style="color: #666666; font-style: italic;color: #439AD0;">// if there's not a thumbnail</span>
<span style="color: #b1b100;color: #439AD0;">else</span> <span style="color: #009900;color: #439AD0;">&#123;</span> <span style="color: #b1b100;color: #439AD0;">echo</span> <span style="color: #0000ff;">''</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #009900;color: #439AD0;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><strong>NOTE ADDED 7/30/10: If you read this post previously, I wrote a note here originally that was pretty much me being stupid.</strong></p>
<p>10) Open your CSS file and add this class:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #6666ff;color: #439AD0;">.thumbnail-class</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">float</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">left</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">width</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">height</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">margin</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #933;">15px</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #cc66cc;color: #439AD0;">0</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>Done. Of course, you still have to create the images though. Note the size of the image is actually controlled through the CSS. Meaning, even if the image you created is 300 by 300, whatever you put in the css is what it will display at. You can also call the class, and Key names whatever you wish, just be sure to change them in the php code as well.</p>
<p>For a more detailed explanation, you will want to read the article I linked to above. I searched for quite a while before I found his tutorial and it rocks. I just had to read more to accomplish it. He also gives hints on what else you can do with it. Very good read though.</p>
<h3>Compass&#8217; inline image function</h3>
<p>I am not recommending you do this, I am just showing you how. Let&#8217;s say you have a bunch of sprites, they are all small, and you don&#8217;t want the extra http requests on your website. Pretty understandable, which is why I use minify on my main site for the css and javascript files. Compass has a built in function that lets you actually embed an image into the CSS file. &#8220;Holy HELL! That&#8217;s insane!&#8221; That is what your head is screaming at the screen, right? That is what I said too when I saw it. I wish I could remember where, but I forgot to paste the url in my Evernote&#8230;just the code.</p>
<p>In your .sass file (yes Sass&#8230;I highly recommend it),you make a style like so:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #6666ff;color: #439AD0;">.mySprite</span>
  <span style="color: #000000; font-weight: bold;color: #439AD0;">background-image</span><span style="color: #00AA00;color: #439AD0;">:</span> inline-image<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #ff0000;color: #439AD0;">&quot;images/mySprite.png&quot;</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> <span style="color: #808080; font-style: italic;color: #439AD0;">/* ! */</span>
  <span style="color: #000000; font-weight: bold;color: #439AD0;">height</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">35px</span>
  <span style="color: #000000; font-weight: bold;color: #439AD0;">width</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">35px</span></pre></div></div>

<p>Compass then embeds the image into the CSS file. You can obviously think ahead on why this could be bad if you do this a lot. You are adding weight to the actual CSS file. Which of course this is why you would only do it with some small file size sprites. I can see this being good for small sites, but probably not anything of substantial size. Just use your head before you actually use this.</p>
<p><strong>NOTE ABOUT THIS TRICK:</strong> IE6 and 7 do NOT support this. You will have to include the style the normal way for those browsers, if you are supporting them.</p>
<h3>Last thoughts</h3>
<p>Hope you learned something! I know I did today, which is what I strive for every day. If you are using Custom Fields for WordPress, I would love to know about how you are using them, and the code for doing it! Share the love people!</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>.after();</strong><br />
This method inserts the specified content after each matched element. Below adds a paragraph tag with text after any element with the class &#8216;myClass&#8217; on it.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'.myClass'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">after</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'&lt;p&gt;Even more content to read!&lt;/p&gt;'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=435" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/07/wordpress-custom-fields-plus-compasssass-tip-css-inline-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blogging&#8230;all in a night&#8217;s work!</title>
		<link>http://jc-designs.net/blog/2010/07/blogging-all-in-a-nights-work/</link>
		<comments>http://jc-designs.net/blog/2010/07/blogging-all-in-a-nights-work/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 04:28:50 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=427</guid>
		<description><![CDATA[
			
				
			
		
It&#8217;s not just publish and you&#8217;re done
Tonight I thought I would take you through what it actually takes to blog. I mean the day to day crap. If you think it&#8217;s just write a post, publish and done, then you are seriously mistaken. There is a ton of other things involved that go on to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fblogging-all-in-a-nights-work%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fblogging-all-in-a-nights-work%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<h3>It&#8217;s not just publish and you&#8217;re done</h3>
<p>Tonight I thought I would take you through what it actually takes to blog. I mean the day to day crap. If you think it&#8217;s just write a post, publish and done, then you are seriously mistaken. There is a ton of other things involved that go on to keep a blog going. I&#8217;m proud of what I have accomplished so far, but there is a lot that goes on behind the scenes here at The Web Machine, and I&#8217;m sure almost any other blog that has effort behind it. Besides the writing, there is the constant tinkering, rearranging, testing, security, moderating&#8230;the list goes on and on.</p>
<p>So if you are thinking about starting your own web development blog, read on, and then see if you are up to it.</p>
<p><span id="more-427"></span></p>
<h3>Beware the spam</h3>
<p>The Web Machine is powered by <a href="http://wordpress.org/">WordPress</a>, a great blogging/CMS platform. I use it for both, but for now let&#8217;s worry about the blogging side of it. This is not the most popular blog by far, but I still get spammed with an amazing amount of crap. From junk comments trying to get linked here, to flat out spam filled with links to who knows what. Luckily, Akismet and WP Spam Free takes care of the latter, but the other I actually see. Stuff like &#8220;I liked your post. I thought about writing something similar, but it seems you were faster.&#8221;</p>
<p>That kind of stuff is very common, and they are all worded differently, but with enough thought behind it that you might actually think it was a genuine comment. You can tell its garbage by looking at the link they filled in. So every night, i get to read through about 5-10 of those to make sure some real comment didn&#8217;t get accidentally tagged as spam, and then delete them. Even if you are just starting out, you are going to have to go through this. If you are not moderating and letting anything through, then you will have a TON of posted comments linking out to some dysfunctional product you don&#8217;t want to advertise.</p>
<h3>Security</h3>
<p>Getting hacked is one of my greatest fears. If you think it isn&#8217;t a serious problem, go read about the fun Chris Coyier has been having at his <a href="http://digwp.com/2010/07/media-temple-wordpress-hack/">Digging Into WordPress blog</a>. He has been nicely hacked a couple times, the link above goes to his article about one I hadn&#8217;t heard about, but he also got the Pharma hack. That one is a pain in the ass because you won&#8217;t know it unless you do a Google search and you see the nice pharmaceutical stuff in the results. Not fun to get rid of. My point? You have to do constant reading on how to protect your blog, constantly making sure you are doing what you can to keep your security nice and tight.</p>
<p>Ok&#8230;I lied. The actual being hacked isn&#8217;t my greatest fear. Its getting hacked and possibly losing all of my content. Which is why I back my database up constantly. You don&#8217;t want to see all of your hard work evaporated in an instant. So, add that step into your schedule.</p>
<h3>Constant updating and then more&#8230;well&#8230;stuff</h3>
<p>I change The Web Machine almost every other night, be it style changes, moving things around, adding things&#8230;it NEVER ends. Just tonight I changed my social icons to the right, because I didn&#8217;t like the ones I had. Then I added the number of feed subscribers bit so I don&#8217;t have to log in just to see if there were more. What else&#8230;oh ya, found a style conflict I had to take care of, ditched the archives, changed the font size limit on the tag cloud (which I&#8217;m not sure anyone uses, so that might eventually go), and added <a href="onextrapixel.com">onextrapixel.com</a> to the blog roll.</p>
<p>Just when you think your blog is perfect, you will find something else to add or change. You are dead wrong if you think there is ever a state of being done with the design of a blog.</p>
<h3>But what about the writing?</h3>
<p>Ohhhh ya, that. Obviously that is the most time consuming. Last night&#8217;s article? I put a lot of effort into that. 7 Google searches, 2 books to reference, building the demo, writing the code, then writing the post. That took me 3 hours to write. Now do that often enough to keep people coming back to your blog. And you thought the writing would be easy. It&#8217;s the hardest part!</p>
<p>Oh, I have plenty to write about, you say. Bull. You might think you do, but wait till you are a couple weeks in. That is when the real test comes. I spend a ton of time reading tweets, rss feeds, random clicking and what not researching and getting ideas, or just plain getting inspired. Coming up with something to write about is probably the most difficult thing you have to do. Get ready to read, read, read, and&#8230;&#8230;..ya&#8230;.read. Writing about just anything is easy. Writing something that you and others actually care about though&#8230;well I think you get the idea.</p>
<h3>Get it out there</h3>
<p>So you wrote your post. Good for you! How are you getting people to notice your blog? Well, when you are done, I&#8217;m assuming you have your blog hooked up to twitter. No? Go do that over at <a href="twitterfeed.com">twitterfeed.com</a>. I told you hitting publish was the least of your worries. After you do that, your blog will post a little tweet letting all your followers know you just wrote some crap. &#8220;Hey F#$@ers! Come read my crazy!&#8221;</p>
<p>Theeeeen&#8230;sign up for accounts at a ton of other article posting sites, which takes more time than even I thought. Once you have all those made (i have only 3 at the moment), submit the links and pray people click on the &#8220;This rocks, blend it, float it, bump it!&#8221; </p>
<p>Once you have all that set up&#8230;log into them after every awesome post you write. It will get easier after the first couple, but this still takes time.</p>
<h3>Let&#8217;s call it a night&#8230;I&#8217;m pooped</h3>
<p>While it might not seem like it would take a lot to write this post, I did more than just that. I spent an hour changing the images, an hour writing this, couple minutes worth of deleting spam, couple minutes tweeting, 10 minutes posting articles to places like The Web Blend, Design Bump and other sites like it. All in all, just tonight, I spent roughly 2 hours for you to spend 5 minutes here.</p>
<p>Anything else I missed? Let me know, cause its hard to think of what else I have to do. Thank God I love doing it, otherwise it would seem like work, but I love that, too. Getting 1 cool comment makes it all worth the effort. I promise. </p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>.change();</strong><br />
This event is fired when the matched element&#8217;s value changes. It is limited to input, textarea and select elements. Below will pop up an alert box when the value of &#8216;myInput&#8217; changes.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'.myInput'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">change</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #003366; font-weight: bold;color: #439AD0;">function</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
<span style="color: #000066;color: #439AD0;">alert</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'Are you sure you want to change that?'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
<span style="color: #009900;color: #439AD0;">&#125;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=427" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/07/blogging-all-in-a-nights-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using jQuery&#8217;s hover() event to the fullest</title>
		<link>http://jc-designs.net/blog/2010/07/using-jquerys-hover-event-to-the-fullest/</link>
		<comments>http://jc-designs.net/blog/2010/07/using-jquerys-hover-event-to-the-fullest/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 07:08:05 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=421</guid>
		<description><![CDATA[
			
				
			
		
The problem
Today at work I was given the task of using jQuery to create a very specific effect. I have an unordered list with three list items. When the user rolls over one of them, the item gets a class which sets the background to a new color, while any other item that has that [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fusing-jquerys-hover-event-to-the-fullest%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fusing-jquerys-hover-event-to-the-fullest%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<h3>The problem</h3>
<p>Today at work I was given the task of using jQuery to create a very specific effect. I have an unordered list with three list items. When the user rolls over one of them, the item gets a class which sets the background to a new color, while any other item that has that class, has it removed. On top of that, if the container the list is in loses focus (meaning the cursor leaves the container), the last list item hovered on should retain the background changing class. On top of THAT, whenever one of those said list items is hovered over, one of three content divs below it should go from hidden to visible. Oh, and I have to have the second item started off as looking like the hover state. This one took me a while to figure out. I could get the normal rollover, but the keeping the class thing when the list item lost focus through me for a loop.</p>
<p><a href="http://www.jc-designs.net/demo/hoverOver.html" target="_blank">Click here</a> to take a look at the final working jQuery. You&#8217;ll see what I was trying to do if you roll over and out and what not.</p>
<p><span id="more-421"></span></p>
<h3>Code Red</h3>
<p>The html is simple enough, but if you want to follow along with what I did, here you go:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;color: #439AD0; font-weight: bold;">&lt;div id=&quot;container&quot;&gt;
	&lt;ul id=&quot;buttons&quot;&gt;
    	&lt;li&gt;Box 1&lt;/li&gt;
        &lt;li&gt;Box 2&lt;/li&gt;
        &lt;li&gt;Box 3&lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;
&lt;div id=&quot;content&quot;&gt;
	&lt;div id=&quot;cont1&quot;&gt;Content 1 box&lt;/div&gt;
    &lt;div id=&quot;cont2&quot;&gt;Content 2 box&lt;/div&gt;
    &lt;div id=&quot;cont3&quot;&gt;Content 3 box&lt;/div&gt;
&lt;/div&gt;</pre></div></div>

<p>The CSS is irrelevant other than the &#8216;over&#8217; class (which just changes the list item background color to purple), so I won&#8217;t list it, but here is the jQuery:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#cont1, #cont3'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
	$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#cont2'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
	$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#buttons li:nth(1)'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'over'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
	<span style="color: #003366; font-weight: bold;color: #439AD0;">var</span> cont1 <span style="color: #339933;color: #439AD0;">=</span> $<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#cont1'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
	<span style="color: #003366; font-weight: bold;color: #439AD0;">var</span> cont2 <span style="color: #339933;color: #439AD0;">=</span> $<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#cont2'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
	<span style="color: #003366; font-weight: bold;color: #439AD0;">var</span> cont3 <span style="color: #339933;color: #439AD0;">=</span> $<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#cont3'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
	<span style="color: #003366; font-weight: bold;color: #439AD0;">var</span> button <span style="color: #339933;color: #439AD0;">=</span> $<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#buttons li'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #000066;color: #439AD0;">focus</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
&nbsp;
	$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#buttons li'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #003366; font-weight: bold;color: #439AD0;">function</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span>	
			<span style="color: #003366; font-weight: bold;color: #439AD0;">var</span> target <span style="color: #339933;color: #439AD0;">=</span> button.<span style="color: #660066;">index</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000066; font-weight: bold;color: #439AD0;">this</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
			$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#buttons li'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'over'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
			$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000066; font-weight: bold;color: #439AD0;">this</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'over'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
&nbsp;
			<span style="color: #000066; font-weight: bold;color: #439AD0;">if</span><span style="color: #009900;color: #439AD0;">&#40;</span>target <span style="color: #339933;color: #439AD0;">==</span> <span style="color: #CC0000;color: #439AD0;">0</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
				cont1.<span style="color: #660066;">show</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span>
				cont2.<span style="color: #660066;">hide</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
				cont3.<span style="color: #660066;">hide</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
			<span style="color: #009900;color: #439AD0;">&#125;</span> <span style="color: #000066; font-weight: bold;color: #439AD0;">else</span> <span style="color: #000066; font-weight: bold;color: #439AD0;">if</span> <span style="color: #009900;color: #439AD0;">&#40;</span>target <span style="color: #339933;color: #439AD0;">==</span> <span style="color: #CC0000;color: #439AD0;">1</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #009900;color: #439AD0;">&#123;</span>
				cont1.<span style="color: #660066;">hide</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span>
				cont2.<span style="color: #660066;">show</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
				cont3.<span style="color: #660066;">hide</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
			<span style="color: #009900;color: #439AD0;">&#125;</span> <span style="color: #000066; font-weight: bold;color: #439AD0;">else</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
				cont1.<span style="color: #660066;">hide</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span>
				cont2.<span style="color: #660066;">hide</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
				cont3.<span style="color: #660066;">show</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
			<span style="color: #009900;color: #439AD0;">&#125;</span><span style="color: #339933;color: #439AD0;">;</span>
&nbsp;
	<span style="color: #009900;color: #439AD0;">&#125;</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #003366; font-weight: bold;color: #439AD0;">function</span> <span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
			$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000066; font-weight: bold;color: #439AD0;">this</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'over'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
			<span style="color: #000066; font-weight: bold;color: #439AD0;">if</span><span style="color: #009900;color: #439AD0;">&#40;</span>$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#buttons'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #000066;color: #439AD0;">blur</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
				$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000066; font-weight: bold;color: #439AD0;">this</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'over'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
			<span style="color: #009900;color: #439AD0;">&#125;</span> <span style="color: #000066; font-weight: bold;color: #439AD0;">else</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
				$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000066; font-weight: bold;color: #439AD0;">this</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'over'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>	
			<span style="color: #009900;color: #439AD0;">&#125;</span>
	<span style="color: #009900;color: #439AD0;">&#125;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

<h3>The Solution</h3>
<p>Let me first say that there is probably a more efficient way to do this, and I&#8217;ll post updates as I shave some of the code down. This works though, so if you are ever in need of doing something like this, or parts of it, here goes the explanation.</p>
<p>The first two lines are to get the second content div to show, while the other two are hidden. The third line (shown below) is to get the second list item the over class, which is the rollover state (purple color).</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#buttons li:nth(1)'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'over'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

<p>After that, I am setting three variables that I will use later in the if/else state. The last line in that section is to set a variable (button) to whatever list item has focus:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #003366; font-weight: bold;color: #439AD0;">var</span> button <span style="color: #339933;color: #439AD0;">=</span> $<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#buttons li'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #000066;color: #439AD0;">focus</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

<h3>The fun part!</h3>
<p>Onto the actual hover! Obviously I am setting the hover onto the &#8216;li&#8217;, and right after that, I have another variable called target. This is equal to the index value of whatever list item has focus. Directly after that I am removing the class &#8216;over&#8217; from all of the list items (kind of like a reset), and then re-adding the &#8216;over&#8217; class to the hovered over li. This takes care of the color switch while rolling over any of the list items while staying within the ul element.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #000066; font-weight: bold;color: #439AD0;">if</span><span style="color: #009900;color: #439AD0;">&#40;</span>target <span style="color: #339933;color: #439AD0;">==</span> <span style="color: #CC0000;color: #439AD0;">0</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
				cont1.<span style="color: #660066;">show</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span>
				cont2.<span style="color: #660066;">hide</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
				cont3.<span style="color: #660066;">hide</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
			<span style="color: #009900;color: #439AD0;">&#125;</span> <span style="color: #000066; font-weight: bold;color: #439AD0;">else</span> <span style="color: #000066; font-weight: bold;color: #439AD0;">if</span> <span style="color: #009900;color: #439AD0;">&#40;</span>target <span style="color: #339933;color: #439AD0;">==</span> <span style="color: #CC0000;color: #439AD0;">1</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #009900;color: #439AD0;">&#123;</span>
				cont1.<span style="color: #660066;">hide</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span>
				cont2.<span style="color: #660066;">show</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
				cont3.<span style="color: #660066;">hide</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
			<span style="color: #009900;color: #439AD0;">&#125;</span> <span style="color: #000066; font-weight: bold;color: #439AD0;">else</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
				cont1.<span style="color: #660066;">hide</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span>
				cont2.<span style="color: #660066;">hide</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
				cont3.<span style="color: #660066;">show</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
			<span style="color: #009900;color: #439AD0;">&#125;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

<p>What is all that crap? That is to show and hide the content divs. This is where my code can probably be a lot better, but I&#8217;m under a time crunch, and I worked on it at home. If the index value of the list items (which is what target is set to) is equal to 0, show the first content div (cont1), and hide the other two. The else if shows the middle, and the else shows the third. That takes care of the hover. Now onto the&#8230;well, un-hover.</p>
<h3>What happens when I move my mouse away from that garbage?</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #009900;color: #439AD0;">&#125;</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #003366; font-weight: bold;color: #439AD0;">function</span> <span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
			<span style="color: #000066; font-weight: bold;color: #439AD0;">if</span><span style="color: #009900;color: #439AD0;">&#40;</span>$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#buttons'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #000066;color: #439AD0;">blur</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
				$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000066; font-weight: bold;color: #439AD0;">this</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'over'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
			<span style="color: #009900;color: #439AD0;">&#125;</span> <span style="color: #000066; font-weight: bold;color: #439AD0;">else</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
				$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000066; font-weight: bold;color: #439AD0;">this</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'over'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>	
			<span style="color: #009900;color: #439AD0;">&#125;</span>
	<span style="color: #009900;color: #439AD0;">&#125;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

<p>When the user rolls off of the list item, it checks to see: did they leave the unordered list? If they did, add the class back to the list item they were on last, otherwise remove the class &#8216;over&#8217;, because it means they are rolling over a different list item.</p>
<p><strong>*NOTE &#8211; blur() is the opposite of focus(). The blur event is sent to an element when it loses focus.</strong></p>
<h3>Conclusion</h3>
<p>This was one of those times where it really hit home to think about what you need things to do before just jumping into writing the code. I did it in small chuncks, starting with what needs to start hidden/shown. Then broke it down into the hover section, and the un-hover chunck. Is this the perfect solution? No, I know I can trim this down. Maybe with a case switch? Or better variables for the content divs? Delegate? If you see something I can improve, let me know. I&#8217;ll personally keep working on refining it, and I&#8217;ll let you know when I come up with something better. I think that, since this post dealt with jQuery, I&#8217;ll leave off the jQuery junkBox section tonight. I don&#8217;t want to overload your mind.</p>
<p>As always, let me know if you have any questions.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=421" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/07/using-jquerys-hover-event-to-the-fullest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paprika to get organized, Microdata, and ranting</title>
		<link>http://jc-designs.net/blog/2010/07/paprika-to-get-organized-microdata-and-ranting/</link>
		<comments>http://jc-designs.net/blog/2010/07/paprika-to-get-organized-microdata-and-ranting/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 15:39:06 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[Cool Links]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cool link]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=410</guid>
		<description><![CDATA[
			
				
			
		
Get organized
 Let&#8217;s start with Paprika. I know in my post &#8220;Creating your own web dev tool kit – Part III: Apps that help&#8221; I told you about todotweet.com. It is still a great little twitter app, but I have found that Paprika suits me better. It is just another little note taker type thing [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fpaprika-to-get-organized-microdata-and-ranting%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fpaprika-to-get-organized-microdata-and-ranting%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<h3>Get organized</h3>
<p><img src="http://jc-designs.net/newimages/paprika.jpg" alt="Paprika logo" class="right" /> Let&#8217;s start with <a href="http://getpaprika.com/">Paprika</a>. I know in my post &#8220;<a href="http://jc-designs.net/blog/2010/06/creating-your-own-web-dev-tool-kit-%E2%80%93-part-iii-apps-that-help/" target="_blank">Creating your own web dev tool kit – Part III: Apps that help</a>&#8221; I told you about todotweet.com. It is still a great little twitter app, but I have found that Paprika suits me better. It is just another little note taker type thing that lets me create projects with to do lists in them.</p>
<div class="center">
<img src="http://jc-designs.net/newimages/paprikaScreen.jpg" alt="Paprika screenshot" />
</div>
<p>As you can see from this little screen I have a project name of The Web Machine, an h1 tag that is the Things to do&#8230;, 3 tags (Design, Coding, and Articles), and something to do under each. Paprika is so easy to use, and along with the base amount of features that I want, I&#8217;ve made it my new to do list app. You do have to create an account, which is also stupid easy (like 4 fields to enter), after which they give you your own url. Login, and you are off.</p>
<p><span id="more-410"></span><br />
You want to create a tag called Awesome? Type #Awesome. Thats it! Want to create a check box to do list? For each item you type in put a dash in front of it, followed by a space. The calander icon pops up when you type in a date. Want something bold, surround it with *.</p>
<p>Now a lot of you are probably saying &#8220;But what about that other app <a href="http://www.rememberthemilk.com/">rememberthemilk.com</a>?&#8221; Ya, I know you can have crap emailed, IM&#8217;d, tweeted and facebooked or whatever it does, and I did try it. Guess what I found out? I don&#8217;t need any of that crap. It&#8217;s over complicated, at least for me. I just need a basic list app with the exact features Paprika offers, so I stop wasting paper, which I can&#8217;t remember where I put half the time. Check it out, and get organized.</p>
<h3>MicroData &#8211; it&#8217;s data that is&#8230;micro?</h3>
<p>I&#8217;m not going to claim that I know anything about MicroData. There is just to little information in the way of clear explanations on what it does. I mean in layman&#8217;s terms, not technical jargon crap. The closest I came to actually understanding it, came from Nettuts&#8217; article <a href="http://net.tutsplus.com/tutorials/html-css-techniques/html5-microdata-welcome-to-the-machine/">HTML5 Microdata: Welcome to the Machine</a>. I&#8217;ll quote John Cox, the author of that article:</p>
<blockquote><p>&#8220;&#8230;Microdata is a subset of making a document have meaning to machines, just as it has meaning to a reader of the document.&#8221; and &#8220;We can now provide context from our HTML to give better search results.&#8221;</p></blockquote>
<p>All you really do is add attributes to an element (like a div or a span) that holds the relevant information. I added some to my footer last night, so I&#8217;ll give you an example of what I&#8217;m talking about:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;color: #439AD0; font-weight: bold;">&lt;div itemscope itemtype=&quot;http://data-vocabulary.org/Person&quot;&gt;
&lt;span itemprop=&quot;name&quot;&gt;Jeremy Carlson&lt;/span&gt; - &lt;span itemprop=&quot;title&quot;&gt;Web Designer/Developer&lt;/span&gt;
&lt;/div&gt;</pre></div></div>

<p>As you can see all I&#8217;m adding are these new attributes. It shows up the same in the browser, which you can see in my footer below, but apparently gives more context for searching. Now, I don&#8217;t know if this actually helps in a regular Google search or not, but I am going to guess that it does. Once you have your Microdata added, you can then check the results <a href="http://www.google.com/webmasters/tools/richsnippets">here</a>. This is what my results looked like:</p>
<div class="center">
<img src="http://jc-designs.net/newimages/microData.jpg" alt="My microdata results" />
</div>
<p>If you want to read more about Microdata, check the link above to the Nettuts article, and go <a href="http://www.google.com/support/webmasters/bin/answer.py?answer=176035">here</a>.</p>
<h3>Enough crap&#8230;give me something I can use already!</h3>
<p>Small rant now, so feel free to disregard this. It&#8217;s really about several things. I used to not care about list articles. Some I thought were useful, but it seems lately that it is getting close to absurd. Enough of the 30 Best Designed Websites in Poland crap. I really don&#8217;t have time to care about articles like these. I want you to actually teach or show me something I didn&#8217;t know. I&#8217;m not what you call an &#8220;elite&#8221; blog, but I do try to show you guys something new or how to solve a problem with every post. I feel that in the past month, the quality of articles posted on the major design/developer blogs we all go to has diminished. You want to actually inpsire me? Write some awesome new tutorials on getting started with Ruby, cool jQuery that is NOT about a plugin, CSS that doesn&#8217;t just work in webkit browsers, and things relevant to actual development.</p>
<p>Second part of rant coming&#8230;..oooohhh, now! FREE icons, background images, fonts&#8230;.whatever resource the blog of the day is handing out. Free to me means I can do whatever the hell I want with what you are giving away. How many of you actually look at the license that those fonts or especially those icons we all love? I&#8217;m guessing very few of you. Most of those awesome icons, say from SmashingMagazine.com, are ONLY for personal use, and on top of that, you MUST provide an attribution link to the person who created it! Screw that! Do you know how many links we would all have on our pages? That is why I generally create my own, or find ones that are actually&#8230;what&#8217;s the word&#8230;oh ya&#8230;FREE!</p>
<p>If I have to attribute the creator, it is not free to me. They are letting me borrow it. It is like renting a car that has a bumper sticker from the company renting the car to you. I don&#8217;t want that crap all over my sites. PLUS&#8230;I can&#8217;t use it for ANY of my freelance sites, or for work for that matter, because they aren&#8217;t personal sites! COMPLETELY USESLESS ICONS AND FONTS!</p>
<p>Whew&#8230;I&#8217;m glad I got that off my chest. I know I feel better, how about you? </p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>.replaceWith();</strong><br />
Because it pertains to my previous article, in case you didn&#8217;t read it. This method will replace whatever you matched with what is in the parenthesis. So below, from my real world example, it would replace the html of the a tag within &#8216;container&#8217; with the html provided.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#container a'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">replaceWith</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'&lt;a href=&quot;/pageOne.html&quot;&gt;Page One&lt;/a&gt;'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=410" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/07/paprika-to-get-organized-microdata-and-ranting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Real example of jQuery&#8217;s replaceWith()&#8230;and Ext&#8217;s method</title>
		<link>http://jc-designs.net/blog/2010/07/real-example-of-jquerys-replacewith-and-exts-method/</link>
		<comments>http://jc-designs.net/blog/2010/07/real-example-of-jquerys-replacewith-and-exts-method/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 05:20:55 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=404</guid>
		<description><![CDATA[
			
				
			
		
What the hell is Ext?
That is what you are asking yourself, right? It&#8217;s another javacsript library, which I have gotten into many an argument over why one would use it over another library. Personally, I find it to be more like writing straight javacsript (which I suck at). My point isn&#8217;t to get you to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Freal-example-of-jquerys-replacewith-and-exts-method%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Freal-example-of-jquerys-replacewith-and-exts-method%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<h3>What the hell is Ext?</h3>
<p>That is what you are asking yourself, right? It&#8217;s another javacsript library, which I have gotten into many an argument over why one would use it over another library. Personally, I find it to be more like writing straight javacsript (which I suck at). My point isn&#8217;t to get you to use it, because I don&#8217;t care. I love jQuery, and that is that. I&#8217;ll show you the difference in this post/article between how jQuery would do something versus how Ext would do it, because I HAD to do it in Ext. On to what I had to accomplish.</p>
<h3>The Problem</h3>
<p>Here is the set up: I have a hard-coded div with two links in it, I am not allowed to touch the actual HTML page itself (meaning the myPage.html), but I do have to change the href of the first link, and the text that displays in it.</p>
<p>For you jQuery newbies, I&#8217;m going to be using first() and replaceWith() to do this, and you will be amazed by the simplicity of it. Because I am not all that familiar with <a href="http://www.sencha.com/products/core/">Ext Core</a> javascript library, I actually had to write this in jQuery first and then translate it over. This though is much easier than when I tried doing that with my slider.</p>
<p><span id="more-404"></span><br />
Here is the HTML to begin with:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;color: #439AD0; font-weight: bold;">&lt;div id=&quot;container&quot;&gt;
&lt;a href=&quot;/feature.html&quot;&gt;FEATURE&lt;/a&gt;
&lt;a href=&quot;/pageTwo.html&quot;&gt;Page Two&lt;/a&gt;
&lt;/div&gt;</pre></div></div>

<p>And here is the jQuery:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#container a'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">first</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">replaceWith</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'&lt;a href=&quot;/pageOne.html&quot;&gt;Page One&lt;/a&gt;'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

<p>Easy as pie: find the &#8216;a&#8217; tags in the div with an &#8216;id&#8217; of container, get the first one, and replace it with what I am giving it. Now lets compare that to how to do it in Ext.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">Ext.<span style="color: #660066;">get</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'container'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">first</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">replaceWith</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#123;</span>tag<span style="color: #339933;color: #439AD0;">:</span> <span style="color: #3366CC;color: #439AD0;">'a'</span><span style="color: #339933;color: #439AD0;">,</span> href<span style="color: #339933;color: #439AD0;">:</span> <span style="color: #3366CC;color: #439AD0;">'/pageOne.html'</span><span style="color: #339933;color: #439AD0;">,</span> html<span style="color: #339933;color: #439AD0;">:</span> <span style="color: #3366CC;color: #439AD0;">'Page One'</span> <span style="color: #009900;color: #439AD0;">&#125;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

<p>These are fairly different. In Ext, the first() is getting the first sibling, where as in jQuery the first() is getting the first of the matched elements. The replaceWith() in Ext is saying what kind of tag, attribute and the html to replace the sibling with. In jQuery, I&#8217;m just giving it the entire chunk of html.</p>
<p>It is differences like these that make Ext a pain in the ass, for me anyways to deal with. Another difference which isn&#8217;t illustrated here, and I should have looked at the documentation faster, is how you actually get elements/classes/ids. For instance, there are two ways to get an id in Ext. The first is simply using &#8216;get&#8217;. The second is &#8216;fly&#8217;. If you need to reference the &#8216;id&#8217; later, you would use &#8216;get&#8217;, but if its a one line I need this done, and I&#8217;m not going to do anything else, you would use &#8216;fly&#8217;. If though, you want to target an element by class, you would use &#8217;select&#8217; instead. That part was frustrating because it took me a while to figure out. I kept trying it the jQuery way by just using &#8216;get&#8217; and the &#8216;.className&#8217;, which didn&#8217;t work.</p>
<h3>Just another reason why I like jQuery</h3>
<p>Personally, I prefer jQuery because of its quickness to the point. Takes less, and for me makes more sense. The argument I have had repeatedly is that Ext actually reads better &#8211; ie. I&#8217;m &#8216;getting&#8217; something, and here is what I&#8217;m doing to it. My opponent in this discussion says that if you have a bunch of code, jQuery is harder for someone else to come in and know what is going on because of how abstracted it is. Its that abstraction which makes it awesome to me though. My side is, if you are commenting on what you are doing, then everything is fine. People without any knowledge of jQuery are not going to understand it anyway, and even more so with Ext. Anyone working on it is going to have some knowledge of libraries, and I think the syntax of jQuery is easier&#8230;just look at the parameters you have to type in the example above in the replaceWith().</p>
<p>The point of this was to show you a real example of something I had to do, and do a slight comparison between two libraries doing the same thing. Have you had to work between two different javascript libraries? If so, let me know which, and the reasons you have for liking one over the other.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>.first();</strong><br />
Because its relevant to the post, this method returns the first of the matched elements. So below, it will return the first list item in the matched set.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'.myList li'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">first</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=404" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/07/real-example-of-jquerys-replacewith-and-exts-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to control CSS3 Radial Gradients</title>
		<link>http://jc-designs.net/blog/2010/07/how-to-control-css3-radial-gradients/</link>
		<comments>http://jc-designs.net/blog/2010/07/how-to-control-css3-radial-gradients/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 07:04:15 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=401</guid>
		<description><![CDATA[
			
				
			
		
Finally, something not so outrageous using CSS3 that we can all understand
I got a link through twitter about a raindrop done using CSS (don&#8217;t bother looking at this in Safari or Chrome, because he write the additional CSS for that). Normally this is the kind of thing that I will look at and say cool, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fhow-to-control-css3-radial-gradients%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjc-designs.net%2Fblog%2F2010%2F07%2Fhow-to-control-css3-radial-gradients%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<h3>Finally, something not so outrageous using CSS3 that we can all understand</h3>
<p>I got a link through twitter about a <a href="http://mozilla.seanmartell.com/raindrop/">raindrop</a> done using CSS (don&#8217;t bother looking at this in Safari or Chrome, because he write the additional CSS for that). Normally this is the kind of thing that I will look at and say cool, but waste of time. This one caught my eye though because it is actually pretty simple. I&#8217;m not going to recreate the damn thing, but all it is, is a bunch of divs and a surprisingly small amount of CSS. I was actually impressed with this one, and I think it could have been done with just an ul and list items. Now, I would still use an image in a real life situation, but I picked this piece because I did not really know how to use the new gradients. This guy obviously does.</p>
<h3>Learnin&#8217;</h3>
<p>That led me to do some small bit of research and tests, and found it is not all that hard, just slightly confusing to get a grasp of what the numbers do. On top of that, the CSS Safari uses to do radial gradients is pretty different.</p>
<p>Some things to note about Safari while doing my demo. I could not get it to recognize percentages for the values in the border radius, so I had to do pixels. I&#8217;m not sure it can or not, and I didn&#8217;t find anything about it. Safari 5 does not <em>need</em> -webkit- in front of border-radius &#8211; it will still use it, so I would include it anyway to support the older versions. </p>
<p>If you look at the demo, you can see a div with a basic radial gradient, with rounded corners set to 100% in FF, and 300px in Safari. This should appear as a circle with red in the middle, then orange fading out to yellow. The second, is just to show you something easy to do with it. It is a png with the word GRADIENT cut out of it, and a drop shadow layer style put on. It then has a div behind it with a radial gradient, which if you ever wanted to change the colors, you wouldn&#8217;t have to use photoshop to do it. Just change the CSS!</p>
<p><a href="http://www.jc-designs.net/demo/radial.html" target="_blank">Click here for demo</a>.</p>
<p><span id="more-401"></span></p>
<h3>So how do you do it already?</h3>
<p>It took me a while to understand what all of the numbers meant, and how to move the gradient around. Using the image below, I&#8217;ll explain what each does in plain English. After reading it, the best way to really get a grasp of it is to mess with it in Firebug, adjusting the numbers.</p>
<p><img src="http://www.jc-designs.net/newimages/grad2.jpg" alt="Gradient CSS image" /></p>
<p><strong>Firefox:</strong><br />
A: This number, as it goes down, moves the center of the gradient left/right, while shrinking/increasing the amount of the center color displayed.<br />
B: Same as A, only top/bottom<br />
C: Adjusts the angle of the gradient, but in circle shape, this doesn&#8217;t do anything<br />
D: Shape of the gradient &#8211; This can be circle or ellipse<br />
E: Size of the gradient. This is like PS, where you can start and end your gradient at any point. This can be set to: closest-side, closest-corner, farthest-side, farthest-corner, contain (same as closest-side), and cover(same as farthest-corner)<br />
F: This is the center color of the gradient<br />
G: The color stop position &#8211; can be from 0 &#8211; 100%</p>
<p><strong>Safari:</strong><br />
A: This sets what type of gradient: linear or radial<br />
B: Moves the gradient left/right and top/bottom while keeping the center of the gradient in the middle (will look like a cone if you move the numbers far enough<br />
C: How much you are fading in or out the center color<br />
D: Moves the center of the gradient left/right and top/bottom while keeping the gradient in the middle<br />
E: How much of the center color that is solid (not faded out) &#8211; mess with this and you will see some cool stuff!<br />
F: The outer color<br />
G: The center color<br />
H: Think of this as the color between the outer and inner colors, and its percentage to show. Note you can do a very smooth gradient without F &#038; G, and only use a bunch of color-stops.</p>
<p>Here is the CSS I used for the circle:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #cc00cc;">#container</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
	-moz-border-radius<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;"><span style="color: #cc66cc;color: #439AD0;">100</span>%</span><span style="color: #00AA00;color: #439AD0;">;</span>
	border-radius<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">width</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">height</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">margin</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">50px</span> <span style="color: #993333;color: #439AD0;">auto</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><span style="color: #00AA00;color: #439AD0;">:</span> 
		-moz-radial-gradient<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #933;">150px</span> <span style="color: #933;">150px</span> 0deg<span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #993333;color: #439AD0;">circle</span> closest-side<span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc00cc;">#ff0000</span> <span style="color: #933;"><span style="color: #cc66cc;color: #439AD0;">0</span>%</span><span style="color: #00AA00;color: #439AD0;">,</span> orange <span style="color: #933;"><span style="color: #cc66cc;color: #439AD0;">50</span>%</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #993333;color: #439AD0;">yellow</span> <span style="color: #933;"><span style="color: #cc66cc;color: #439AD0;">100</span>%</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><span style="color: #00AA00;color: #439AD0;">:</span> 
		-webkit-gradient<span style="color: #00AA00;color: #439AD0;">&#40;</span>radial<span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">150</span> <span style="color: #cc66cc;color: #439AD0;">150</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">100</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">150</span> <span style="color: #cc66cc;color: #439AD0;">150</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">40</span><span style="color: #00AA00;color: #439AD0;">,</span> from<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #993333;color: #439AD0;">yellow</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">,</span> to<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #993333;color: #439AD0;">red</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">,</span> color-stop<span style="color: #00AA00;color: #439AD0;">&#40;</span>.4<span style="color: #00AA00;color: #439AD0;">,</span>orange<span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>Take a look at the demo, copy the HTML and CSS, and start messing around. Once you start fiddling with it, everything will start to make sense. Hopefully my image and little lists helped you to understand CSS3 radial gradients better, and you get a clearer picture on controlling them. Now you can go and do some experimenting and come up with more raindrops.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>.live();</strong><br />
This method attaches a handler to the event for every element that matches what you are searching for &#8211; currently or any added after the fact (which bind() does not do). Below, live() attaches a click event to anything with the class &#8216;touchThis&#8217;, including anything added later to the DOM with the same class.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'.touchThis'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'click'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #003366; font-weight: bold;color: #439AD0;">function</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
<span style="color: #000066;color: #439AD0;">alert</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'You totally just touched that!'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
<span style="color: #009900;color: #439AD0;">&#125;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=401" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/07/how-to-control-css3-radial-gradients/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
