<?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 &#187; Uncategorized</title>
	<atom:link href="http://jc-designs.net/blog/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://jc-designs.net/blog</link>
	<description>jc-designs blog</description>
	<lastBuildDate>Mon, 16 Jan 2012 15:30:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Tutorial &#8211; CSS And jQuery/Ext Trap Door Navigation</title>
		<link>http://jc-designs.net/blog/2011/01/tutorial-css-and-jqueryext-trap-door-navigation/</link>
		<comments>http://jc-designs.net/blog/2011/01/tutorial-css-and-jqueryext-trap-door-navigation/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 23:13:22 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=727</guid>
		<description><![CDATA[Dual library action I&#8217;ll be showing you how to do a trap door navigation, which I&#8217;m sure has been done before. But I&#8217;ll be showing you how to do it in jQuery AND Ext. Why? Because I had to do it in both at work. A trap door navigation is basically a two image system [...]]]></description>
			<content:encoded><![CDATA[<h3>Dual library action</h3>
<p>I&#8217;ll be showing you how to do a trap door navigation, which I&#8217;m sure has been done before. But I&#8217;ll be showing you how to do it in jQuery AND Ext. Why? Because I had to do it in both at work. A trap door navigation is basically a two image system where the &#8216;li&#8217; gets one image, and the &#8216;a&#8217; tag gets another so that as the link expands, the image grows with it. When you rollover each navigation item, the images then change.</p>
<p>Why thought can&#8217;t you do this with just CSS? You could try like I did using something like &#8216;li:hover&#8217;, but the problem occurs on when the images actually change on rollover. There are issues with the &#8216;li&#8217; image changing because the &#8216;a&#8217; tag is on top and that is what you are rolling over. Javascript is used then to correct the issue. Check out the result:</p>
<p><a target="_blank" class="viewDemo" href="http://www.jc-designs.net/demo/trapDoor.html">View Demo</a></p>
<p><span id="more-727"></span><br />
What you need to start with, is a cut up image (I prefer slicing, but you do it however you want). You need to versions: what the buttons will look like normally, and what they look like on hover. You end up with 4 images &#8211; 2 for the normal, 2 for hover. Below is what I did for the rollover image:</p>
<div class="center">
<div id="attachment_796" class="wp-caption alignnone" style="width: 577px"><img src="http://jc-designs.net/blog/wp-content/uploads/2011/01/trapSliced.jpg" alt="Sliced nav image" title="trapSliced" width="567" height="78" class="size-full wp-image-796" /><p class="wp-caption-text">Sliced nav image</p></div>
</div>
<p>The slice with the number 2 is what goes on the &#8216;li&#8217;, while the &#8217;1&#8242; goes on the &#8216;a&#8217; tag.</p>
<p>Here is the basic HTML you need:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;color: #439AD0; font-weight: bold;">&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;About Us&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Services&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Our Really Kick Ass Blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Contact us&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre></div></div>

<p>Below is the CSS you need (any other tags don&#8217;t matter for the tutorial). As you can see, the &#8216;li&#8217; has a background call for the image that is seen normally, and it is the longer image of the two. The &#8216;a&#8217; tag has a background call of the shorter image.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;">li <span style="color: #00AA00;color: #439AD0;">&#123;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">list-style</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">none</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> <span style="color: #993333;color: #439AD0;">url</span><span style="color: #00AA00;color: #439AD0;">&#40;</span>images/trapOff_02.jpg<span style="color: #00AA00;color: #439AD0;">&#41;</span> <span style="color: #993333;color: #439AD0;">no-repeat</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">right</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">top</span><span style="color: #00AA00;color: #439AD0;">;</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: #00AA00;color: #439AD0;">&#125;</span>
&nbsp;
a <span style="color: #00AA00;color: #439AD0;">&#123;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">text-decoration</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">none</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">color</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">display</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">block</span><span style="color: #00AA00;color: #439AD0;">;</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;">text-transform</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">uppercase</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> <span style="color: #993333;color: #439AD0;">url</span><span style="color: #00AA00;color: #439AD0;">&#40;</span>images/trapOff_01.jpg<span style="color: #00AA00;color: #439AD0;">&#41;</span> <span style="color: #993333;color: #439AD0;">no-repeat</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">left</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">top</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">padding</span><span style="color: #00AA00;color: #439AD0;">:</span><span style="color: #933;">11px</span> <span style="color: #933;">16px</span> <span style="color: #933;">3px</span> <span style="color: #933;">13px</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span>
&nbsp;
a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;color: #439AD0;">&#123;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">color</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>Now onto the jQuery, which I&#8217;ll explain after you look over 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;">'ul&gt;li&gt;a'</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: #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;">parent</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'background-image'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #3366CC;color: #439AD0;">'url(&quot;images/trapOn_02.jpg&quot;)'</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;">css</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">&quot;background-image&quot;</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #3366CC;color: #439AD0;">'url(&quot;images/trapOn_01.jpg&quot;)'</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> <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;">parent</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'background-image'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #3366CC;color: #439AD0;">'url(&quot;images/trapOff_02.jpg&quot;)'</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;">css</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'background-image'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #3366CC;color: #439AD0;">'url(&quot;images/trapOff_01.jpg&quot;)'</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>

<h3>The break down</h3>
<p>All it is, is a basic hover() method. The first line above, searches for the &#8216;a&#8217; tag in a list item within a ul (ul>li>a), and puts the hover() method on it. The second line finds the &#8216;a&#8217; tag, but get&#8217;s its parent, which would be its it containing &#8216;li&#8217;. It then uses the css() method to change the background-image to the rollover state image. The third line does the same for the actual &#8216;a&#8217; tag.</p>
<p>The callback function, then reverses the images so that when you are not hovering over the navigation item, it goes back to normal. That is all there is to it.</p>
<h3>Ext &#8211; The Extra Terrestrial</h3>
<p>To do the same exact thing in Ext JS, some of the stuff changes. I won&#8217;t go over it, because most of you probably don&#8217;t even know the library exists, but you can see the differences.</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;">select</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'div#slot-navigation&gt;ul&gt;li&gt;a'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">on</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'mouseover'</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>e<span style="color: #339933;color: #439AD0;">,</span>t<span style="color: #339933;color: #439AD0;">,</span>o<span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
        Ext.<span style="color: #660066;">fly</span><span style="color: #009900;color: #439AD0;">&#40;</span>t<span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">setStyle</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#123;</span>
          <span style="color: #3366CC;color: #439AD0;">'background-image'</span><span style="color: #339933;color: #439AD0;">:</span> <span style="color: #3366CC;color: #439AD0;">'url(&quot;/images/trapOn_02.jpg&quot;)'</span>       
        <span style="color: #009900;color: #439AD0;">&#125;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>               
        Ext.<span style="color: #660066;">fly</span><span style="color: #009900;color: #439AD0;">&#40;</span>t<span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">setStyle</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#123;</span>
          <span style="color: #3366CC;color: #439AD0;">'background-image'</span><span style="color: #339933;color: #439AD0;">:</span> <span style="color: #3366CC;color: #439AD0;">'url(&quot;/images/trapOn_01.jpg&quot;)'</span>       
        <span style="color: #009900;color: #439AD0;">&#125;</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> 
&nbsp;
  Ext.<span style="color: #660066;">select</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'div#slot-navigation&gt;ul&gt;li&gt;a'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">on</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'mouseout'</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>e<span style="color: #339933;color: #439AD0;">,</span>t<span style="color: #339933;color: #439AD0;">,</span>o<span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span>               
        Ext.<span style="color: #660066;">fly</span><span style="color: #009900;color: #439AD0;">&#40;</span>t<span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">setStyle</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#123;</span>
          <span style="color: #3366CC;color: #439AD0;">'background-image'</span><span style="color: #339933;color: #439AD0;">:</span> <span style="color: #3366CC;color: #439AD0;">'url(&quot;/images/trapOff_02.jpg&quot;)'</span>       
        <span style="color: #009900;color: #439AD0;">&#125;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>               
        Ext.<span style="color: #660066;">fly</span><span style="color: #009900;color: #439AD0;">&#40;</span>t<span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">setStyle</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#123;</span>
          <span style="color: #3366CC;color: #439AD0;">'background-image'</span><span style="color: #339933;color: #439AD0;">:</span> <span style="color: #3366CC;color: #439AD0;">'url(&quot;/images/trapOff_01.jpg&quot;)'</span>       
        <span style="color: #009900;color: #439AD0;">&#125;</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>

<h3>Final thoughts</h3>
<p>Sometimes CSS isn&#8217;t enough to accomplish a certain effect. In this case, I wish it was because it seems like such a simple thing. But, it doesn&#8217;t take much javascript to make this work. Hope you learned something!</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-" rel="nofollow"><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=727" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2011/01/tutorial-css-and-jqueryext-trap-door-navigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sass Rocks! Over Complicating Your CSS Doesn&#8217;t</title>
		<link>http://jc-designs.net/blog/2010/10/sass-rocks-over-complicating-your-css-doesnt/</link>
		<comments>http://jc-designs.net/blog/2010/10/sass-rocks-over-complicating-your-css-doesnt/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 03:24:50 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[sass]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=600</guid>
		<description><![CDATA[Unless you are careful of course So I&#8217;m in the middle of redesigning/rebuilding my main site, as you would know if you are keeping up with me here, and I am using Sass (SCSS syntax). I love it so far. There is a lot you can do to save you time during the build. There [...]]]></description>
			<content:encoded><![CDATA[<h3>Unless you are careful of course</h3>
<p>So I&#8217;m in the middle of redesigning/rebuilding my main site, as you would know if you are keeping up with me here, and I am using Sass (SCSS syntax). I love it so far. There is a lot you can do to save you time during the build. There is also the &#8220;This new crap I&#8217;m using is awesome! I&#8217;m going to do this and this and this&#8230;&#8221;, which can get you in trouble. What kind of trouble you ask? The kind that over complicates your CSS of course. Stop talking and read please! Jeez, I&#8217;ll tell you how you can easily do that.</p>
<h3>Think before you leap</h3>
<p>A day after starting my build using this awesome technology, and no it isn&#8217;t new, but it is still fairly new to me. Syntactically Awesome Stylesheets has some cool features that you immediately want to dive into. Variables are the easiest, and it is kind of hard to abuse those. Mixins though, that is where I got into trouble. A good example, which you might have seen in my last post is a mixin I was using for &#8216;font&#8217;. Seemed like a great idea at the time! Let&#8217;s shorten that CSS so that I only have to type in the properties that will feed the mixin. What could be wrong with that? Well, technically nothing, but it also wasn&#8217;t helping me and I was just adding to the confusion with a completely stupid mixin (at least in this case). Here is what I am talking about:</p>
<p><span id="more-600"></span></p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #a1a100;color: #439AD0;">@mixin font ($size, $weight, $family){</span>
  <span style="color: #000000; font-weight: bold;color: #439AD0;">font</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
    <span style="color: #000000; font-weight: bold;color: #439AD0;">size</span><span style="color: #00AA00;color: #439AD0;">:</span> $size<span style="color: #00AA00;color: #439AD0;">;</span>
    weight<span style="color: #00AA00;color: #439AD0;">:</span> $weight<span style="color: #00AA00;color: #439AD0;">;</span>
    family<span style="color: #00AA00;color: #439AD0;">:</span> $family<span style="color: #00AA00;color: #439AD0;">;</span>
  <span style="color: #00AA00;color: #439AD0;">&#125;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>To use that mixin, I then type out this SCSS:</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;">.myClass</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
<span style="color: #a1a100;color: #439AD0;">@include font(18px, &quot;bold&quot;, &quot;Arial,Helvetica,sans-serif&quot;);</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>What is wrong with that? Well, let&#8217;s actually write out the CSS for it:</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;">.myClass</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">font</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">bold</span> <span style="color: #933;">18px</span> Arial<span style="color: #00AA00;color: #439AD0;">,</span>Helvetica<span style="color: #00AA00;color: #439AD0;">,</span><span style="color: #993333;color: #439AD0;">sans-serif</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>It&#8217;s actually shorter to write the CSS out rather than using the Sass mixin for it. That was my problem. And not just there. I had a few others with the same exact problem. How did I fix it? I sat there staring at the small amount of CSS I had and actually thought out everything. Where is Sass going to save me time, and where am I being stupid? So I thought about it, and rewrote the mixin. I changed it to have a defualt family since most of the time I am going to be using Arial anyway. The rare occasions where I won&#8217;t is where that variable will come in handy.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #a1a100;color: #439AD0;">@mixin font ($size, $weight, $family: &quot;Arial,Helvetica,sans-serif&quot;){</span>
  <span style="color: #000000; font-weight: bold;color: #439AD0;">font</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
    family<span style="color: #00AA00;color: #439AD0;">:</span> #<span style="color: #00AA00;color: #439AD0;">&#123;</span>$family<span style="color: #00AA00;color: #439AD0;">&#125;</span><span style="color: #00AA00;color: #439AD0;">;</span>
    <span style="color: #000000; font-weight: bold;color: #439AD0;">size</span><span style="color: #00AA00;color: #439AD0;">:</span> $size<span style="color: #00AA00;color: #439AD0;">;</span>
    weight<span style="color: #00AA00;color: #439AD0;">:</span> #<span style="color: #00AA00;color: #439AD0;">&#123;</span>$weight<span style="color: #00AA00;color: #439AD0;">&#125;</span><span style="color: #00AA00;color: #439AD0;">;</span>
  <span style="color: #00AA00;color: #439AD0;">&#125;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>Now I don&#8217;t have to type in the family every time because that is my default. Why be repetitive? That is the beauty of using this. I then wrote this mixin for using a sprite over and over again:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #a1a100;color: #439AD0;">@mixin sprite($left, $top) {</span>
    <span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><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/iconSprite.png</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> <span style="color: #993333;color: #439AD0;">no-repeat</span> $left $top<span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>Now I just have to write &#8220;@include sprite(0, 0)&#8221; to get the sprite call&#8217;s position. This to me is being smart. Mixins should be used to reduce the amount of CSS you have to write later. Using Compass&#8217; &#8216;@import&#8217; to use some of the CSS3 stuff like border-radius and box-shadow was a good call too. When you use that and Sass together, it only takes one line to output the necessary 5 lines for browser pre-fixes. Brilliant! That is the kind of thing I needed to think about. I don&#8217;t want to use Sass just because it is cool, I want to use it the way it should be used &#8211; making dev time faster, and very easy to read/use stylesheets.</p>
<h3>Just because you can doesn&#8217;t mean you should</h3>
<p>This is my main point, and can be applied to any new tech we find or use in our development process. I imagine somewhere there are some people that used every dam CSS3 trick they could because they could, and because it was the new thing. You know, an element with box-shadow, text-shadow, border-radius, gradients, transitions&#8230;you name it, all on one thing. Why? For the look at what I did factor. I want to avoid that with my use of Sass. This build might take me longer than normal, but I want to make sure I&#8217;m not doing anything stupid, so I&#8217;m slowing down and thinking about what I am trying to do first. Where am I going to be calling the same thing over and over, and where will it matter?</p>
<p>I know that sounds silly, because shouldn&#8217;t we be doing that anyway? Yes. But how many times have you designed and sliced up a psd file, know exactly what divs/elements you need and just blaze ahead? I do most of the time. We just start typing away and plugging in everything &#8211; header div here, nav there, sidebar over there, footer here&#8230;need a ul for the nav and one for the footer, bunch of li&#8217;s and links. A lot of it takes no thought at all. You are done before you know it. While I am doing the layout like that no problem, the CSS is taking longer and I think it will help in the long-run. By slowing down and actually thinking about where a mixin would actually help, it&#8217;s helping me by thinking more clearly on my CSS.</p>
<p>I am hoping that by documenting what I am doing using Sass I will help you developers that are new to it, because honestly it is very hard to find information out there that is geared towards the newbie. Most of what I have found is written differently than what I am using (because they are using the original Sass syntax, where I am using its new one &#8211; SCSS) and written as if you are already familiar with it.</p>
<p>Again if you have any tips or pointers, please leave a comment and let me know. If you are just starting to use Sass/SCSS and want a good place to go to read up on it, check out <a href="http://blog.derekperez.com/">Derek Perez&#8217;s</a> blog. Tool around there and you will find some good info. I&#8217;d recommend <a href="http://twitter.com/perezd">following him on twitter</a> as well, because he&#8217;ll tweet some good stuff. He is also very helpful if you have questions.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-" rel="nofollow"><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=600" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/10/sass-rocks-over-complicating-your-css-doesnt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Basics of CSS3 Transitions and Transforms</title>
		<link>http://jc-designs.net/blog/2010/10/the-basics-of-css3-transitions-and-transforms/</link>
		<comments>http://jc-designs.net/blog/2010/10/the-basics-of-css3-transitions-and-transforms/#comments</comments>
		<pubDate>Thu, 07 Oct 2010 02:41:10 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=583</guid>
		<description><![CDATA[Let&#8217;s talk about support First off, we know for a fact that Safari and Chrome support Transitions, because we&#8217;ve all been using one of them to see the cool crap people have been doing. FireFox 4 will support it and they keep adding to it all the time. IE9, as of what I have read, [...]]]></description>
			<content:encoded><![CDATA[<h3>Let&#8217;s talk about support</h3>
<p>First off, we know for a fact that Safari and Chrome support Transitions, because we&#8217;ve all been using one of them to see the cool crap people have been doing. FireFox 4 will support it and they keep adding to it all the time. <a href="http://www.impressivewebs.com/css3-support-ie9/">IE9</a>, as of what I have read, will not. They are still missing a lot of other things, so this is not surprising. But since it is still too early to tell, who knows what the final product will have. The main thing to know is, if you haven&#8217;t started getting your CSS3 chops down, you should start. It won&#8217;t be long before we are using it on a regular basis. Personally, I use quite a few, but transitions is one that I have stayed away from.</p>
<p><span id="more-583"></span></p>
<h3>The basic syntax</h3>
<p>If you have used CSS3 styles, then you are used to the vendor prefixes. They might be annoying, but they make sense and it just means some additional copying. A simple transition you might have seen is to fade in the background color of a button. Here is what the CSS would look like:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;">a <span style="color: #00AA00;color: #439AD0;">&#123;</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;">30px</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">text-align</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">center</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">padding</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">15px</span> <span style="color: #cc66cc;color: #439AD0;">0</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">display</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">block</span><span style="color: #00AA00;color: #439AD0;">;</span> 
<span style="color: #000000; font-weight: bold;color: #439AD0;">color</span><span style="color: #00AA00;color: #439AD0;">:</span><span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">background-color</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;color: #439AD0;">;</span>  
-webkit-transition<span style="color: #00AA00;color: #439AD0;">:</span><span style="color: #000000; font-weight: bold;color: #439AD0;">background-color</span> 1s ease-in<span style="color: #00AA00;color: #439AD0;">;</span>  
-moz-transition<span style="color: #00AA00;color: #439AD0;">:</span><span style="color: #000000; font-weight: bold;color: #439AD0;">background-color</span> 1s ease-in<span style="color: #00AA00;color: #439AD0;">;</span>  
-o-transition<span style="color: #00AA00;color: #439AD0;">:</span><span style="color: #000000; font-weight: bold;color: #439AD0;">background-color</span> 1s ease-in<span style="color: #00AA00;color: #439AD0;">;</span>  
transition<span style="color: #00AA00;color: #439AD0;">:</span><span style="color: #000000; font-weight: bold;color: #439AD0;">background-color</span> 1s ease-in<span style="color: #00AA00;color: #439AD0;">;</span>  
<span style="color: #00AA00;color: #439AD0;">&#125;</span> 
&nbsp;
a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;color: #439AD0;">&#123;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">background-color</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#ff0000</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>It turns out that I had nothing to be afraid of, and neither should you. Type in the vendor prefix, then the colon, followed by the property you are transitioning, the amount of time you want the transition to take, and finally the type.</p>
<h3>Skew, Scale, Rotate, and Translate</h3>
<p>What? These are simple, yet cool. Ever create a button where the text was set at an angle, but you had to use Photoshop to do it? Well, Rotate will keep the text as actual text, and make it easier to fix if someone needs to change what it is saying. Here is what the CSS would look like for each of these:</p>
<p>Skew:</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;">.box</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
-moz-transform<span style="color: #00AA00;color: #439AD0;">:</span>skew<span style="color: #00AA00;color: #439AD0;">&#40;</span>20deg<span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
-webkit-transform<span style="color: #00AA00;color: #439AD0;">:</span>skew<span style="color: #00AA00;color: #439AD0;">&#40;</span>20deg<span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
-o-transform<span style="color: #00AA00;color: #439AD0;">:</span>skew<span style="color: #00AA00;color: #439AD0;">&#40;</span>20deg<span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
transform<span style="color: #00AA00;color: #439AD0;">:</span>skew<span style="color: #00AA00;color: #439AD0;">&#40;</span>20deg<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>Scale &#8211; the numbers are percentages, where 1 = 100%:</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;">.box</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
-moz-transform<span style="color: #00AA00;color: #439AD0;">:</span>scale<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc66cc;color: #439AD0;">1</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">1.5</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
-webkit-transform<span style="color: #00AA00;color: #439AD0;">:</span>scale<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc66cc;color: #439AD0;">1</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">1.5</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
-o-transform<span style="color: #00AA00;color: #439AD0;">:</span>scale<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc66cc;color: #439AD0;">1</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">1.5</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
transform<span style="color: #00AA00;color: #439AD0;">:</span>scale<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc66cc;color: #439AD0;">1</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">1.5</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>Rotate:</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;">.box</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
-moz-transform<span style="color: #00AA00;color: #439AD0;">:</span>rotate<span style="color: #00AA00;color: #439AD0;">&#40;</span>30deg<span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
-webkit-transform<span style="color: #00AA00;color: #439AD0;">:</span>rotate<span style="color: #00AA00;color: #439AD0;">&#40;</span>30deg<span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
-o-transform<span style="color: #00AA00;color: #439AD0;">:</span>rotate<span style="color: #00AA00;color: #439AD0;">&#40;</span>30deg<span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
transform<span style="color: #00AA00;color: #439AD0;">:</span>rotate<span style="color: #00AA00;color: #439AD0;">&#40;</span>30deg<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>Translate:</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;">.box</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
-moz-transform<span style="color: #00AA00;color: #439AD0;">:</span>translate<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #933;">100px</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #933;">100px</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
-webkit-transform<span style="color: #00AA00;color: #439AD0;">:</span>translate<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #933;">100px</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #933;">100px</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
-o-transform<span style="color: #00AA00;color: #439AD0;">:</span>translate<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #933;">100px</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #933;">100px</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
transform<span style="color: #00AA00;color: #439AD0;">:</span>translate<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #933;">100px</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #933;">100px</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>Easy right? Just remember that skew will distort, scale changes size, rotate turns, and translate moves. But what if you want to do more than one transition or transform? That&#8217;s what you want to know now, right? Well, good thing I did the demo that I&#8217;ll link to later, or I wouldn&#8217;t have known. There was a lot of trial and error, smiles and clapping, swearing and finger pointing at the screen, and&#8230;.some discovery.</p>
<h3>You can&#8217;t eat just one!</h3>
<p>First thing to remember: you can only have one transform or transition&#8230;how do I say this without confusing the crap out of you&#8230;property &#8216;line&#8217;. Better if I show you&#8230;</p>
<p>This is the BAD:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;">-webkit-transform<span style="color: #00AA00;color: #439AD0;">:</span> scale<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc66cc;color: #439AD0;">1.5</span><span style="color: #00AA00;color: #439AD0;">,</span><span style="color: #cc66cc;color: #439AD0;">1.5</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
-webkit-transform<span style="color: #00AA00;color: #439AD0;">:</span> rotate<span style="color: #00AA00;color: #439AD0;">&#40;</span>30deg<span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span></pre></div></div>

<p>Why is that bad? Oh my god, I just pasted that in, give me a second you impatient lot. Because like every other property, the second one overwrites the first. For some reason I thought the above would be different though. They are different transitions right? Yes, but of course&#8230;no. Here is what it should look like:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;">-webkit-transform<span style="color: #00AA00;color: #439AD0;">:</span> scale<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc66cc;color: #439AD0;">1.5</span><span style="color: #00AA00;color: #439AD0;">,</span><span style="color: #cc66cc;color: #439AD0;">1.5</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> rotate<span style="color: #00AA00;color: #439AD0;">&#40;</span>30deg<span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span></pre></div></div>

<p>There is one main syntax part to note when doing multiple transitions vs transforms: use a space between each different transform, and a comma to seperate each transition. You can view my little demo below (Safari or Chrome at the moment), and immediately after is the CSS for the bottom button.</p>
<p><a href="http://www.jc-designs.net/demo/transition.html">View Demo</a></p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #cc00cc;">#backMovement</span> a <span style="color: #00AA00;color: #439AD0;">&#123;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">color</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">display</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">block</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;">120px</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;">50px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">padding</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">15px</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #933;">5px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">text-decoration</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">none</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">text-transform</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">uppercase</span><span style="color: #00AA00;color: #439AD0;">;</span>
	-moz-border-radius<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	-webkit-border-radius<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	border-radius<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">border</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">1px</span> <span style="color: #cc00cc;">#f60</span> <span style="color: #993333;color: #439AD0;">solid</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">text-shadow</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">4px</span> <span style="color: #933;">8px</span> <span style="color: #cc00cc;">#F60</span><span style="color: #00AA00;color: #439AD0;">;</span>
	-moz-box-shadow<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">4px</span> <span style="color: #933;">8px</span> <span style="color: #cc00cc;">#F60</span><span style="color: #00AA00;color: #439AD0;">;</span>
	-webkit-box-shadow<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">4px</span> <span style="color: #933;">8px</span> <span style="color: #cc00cc;">#F60</span><span style="color: #00AA00;color: #439AD0;">;</span>
	box-shadow<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">4px</span> <span style="color: #933;">8px</span> <span style="color: #cc00cc;">#F60</span><span style="color: #00AA00;color: #439AD0;">;</span>
	-moz-transform<span style="color: #00AA00;color: #439AD0;">:</span> scale<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc66cc;color: #439AD0;">1.5</span><span style="color: #00AA00;color: #439AD0;">,</span><span style="color: #cc66cc;color: #439AD0;">1.5</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> rotate<span style="color: #00AA00;color: #439AD0;">&#40;</span>30deg<span style="color: #00AA00;color: #439AD0;">&#41;</span> translate<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #933;">50px</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #933;">50px</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> skew<span style="color: #00AA00;color: #439AD0;">&#40;</span>20deg<span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
	-webkit-transform<span style="color: #00AA00;color: #439AD0;">:</span> scale<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc66cc;color: #439AD0;">1.5</span><span style="color: #00AA00;color: #439AD0;">,</span><span style="color: #cc66cc;color: #439AD0;">1.5</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> rotate<span style="color: #00AA00;color: #439AD0;">&#40;</span>30deg<span style="color: #00AA00;color: #439AD0;">&#41;</span> translate<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #933;">50px</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #933;">50px</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> skew<span style="color: #00AA00;color: #439AD0;">&#40;</span>20deg<span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
	-o-transform<span style="color: #00AA00;color: #439AD0;">:</span> scale<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc66cc;color: #439AD0;">1.5</span><span style="color: #00AA00;color: #439AD0;">,</span><span style="color: #cc66cc;color: #439AD0;">1.5</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> rotate<span style="color: #00AA00;color: #439AD0;">&#40;</span>30deg<span style="color: #00AA00;color: #439AD0;">&#41;</span> translate<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #933;">50px</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #933;">50px</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> skew<span style="color: #00AA00;color: #439AD0;">&#40;</span>20deg<span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
	transform<span style="color: #00AA00;color: #439AD0;">:</span> scale<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc66cc;color: #439AD0;">1.5</span><span style="color: #00AA00;color: #439AD0;">,</span><span style="color: #cc66cc;color: #439AD0;">1.5</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> rotate<span style="color: #00AA00;color: #439AD0;">&#40;</span>30deg<span style="color: #00AA00;color: #439AD0;">&#41;</span> translate<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #933;">50px</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #933;">50px</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> skew<span style="color: #00AA00;color: #439AD0;">&#40;</span>20deg<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> <span style="color: #993333;color: #439AD0;">url</span><span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/grid.jpg</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> <span style="color: #993333;color: #439AD0;">no-repeat</span> <span style="color: #933;">0px</span> <span style="color: #933;">-104px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	-moz-transition<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">background-position</span> 1s<span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">color</span> 1s ease-in<span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">text-shadow</span> 1s ease-in<span style="color: #00AA00;color: #439AD0;">;</span>
	-webkit-transition<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">background-position</span> 1s<span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">color</span> 1s ease-in<span style="color: #00AA00;color: #439AD0;">;</span>
	-o-transition<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">background-position</span> 1s<span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">color</span> 1s ease-in<span style="color: #00AA00;color: #439AD0;">;</span>
	transition<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">background-position</span> 1s<span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">color</span> 1s ease-in<span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#backMovement</span> a<span style="color: #3333ff;">:hover</span><span style="color: #00AA00;color: #439AD0;">&#123;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">background-position</span><span style="color: #00AA00;color: #439AD0;">:</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: #000000; font-weight: bold;color: #439AD0;">color</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#F60</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">text-shadow</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">4px</span> <span style="color: #933;">8px</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<h3>Let&#8217;s wrap this up</h3>
<p>You can obviously see that there is a LOT of lines of css for this stupid button. It&#8217;s not even that great looking and it took 31 lines of CSS (block form of course)! Now, think about this&#8230;you want to add a gradient, use multiple images, and god knows what. I realize that realistically a lot of the CSS would be trimmed off of this button because most likely you are not going to rotate, skew, translate, color change, background position movement and who knows what else I put on there. BUT&#8230;if you think about it, most of that is not that far fetched.</p>
<p>Here is something else to consider. Let&#8217;s say you make the button in Photoshop and it is on an image sprite. Which can you do faster, the CSS method or the image method, and what will the actual file size contribution  be? Meaning which will weigh more? You do still need the background image for the CSS method. What you do save in the long run, is time on any changes.</p>
<p>One thing I like about the making a button this way is that you can have chunks of the CSS stored in snippets, so that if you need a particular part, you don&#8217;t have to write it from scratch every time.</p>
<p>What are your thoughts on this? Let&#8217;s here &#8216;em!</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>.scroll();</strong><br />
This event is sent to an element when a person scrolls to a different place in the element. Below, a message displays when a person scrolls within an element with the class &#8216;content&#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;">'.content'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #000066;color: #439AD0;">scroll</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;">'You are scrolling'</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=583" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/10/the-basics-of-css3-transitions-and-transforms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox 4 Beta Review &#8211; A quick look</title>
		<link>http://jc-designs.net/blog/2010/08/firefox-4-beta-review-a-quick-look/</link>
		<comments>http://jc-designs.net/blog/2010/08/firefox-4-beta-review-a-quick-look/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 03:41:09 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=500</guid>
		<description><![CDATA[Spooooooon! If you are not using Spoon, well&#8230;you should. It&#8217;s what I use to test in any freakin&#8217; browser. I&#8217;ve wrote about it before, so go check it out. Anyway, Spoon&#8217;s Browser Sandbox added Firefox 4 Beta, IE9 Preview, and Chrome 6 Beta to its list. I had to take a look at FF4 Beta [...]]]></description>
			<content:encoded><![CDATA[<h3>Spooooooon!</h3>
<p>If you are not using <a href="http://spoon.net/Browsers/">Spoon</a>, well&#8230;you should. It&#8217;s what I use to test in any freakin&#8217; browser. I&#8217;ve wrote about it before, so go check it out. Anyway, Spoon&#8217;s Browser Sandbox added Firefox 4 Beta, IE9 Preview, and Chrome 6 Beta to its list. I had to take a look at FF4 Beta just to see what all the hype was about. Let&#8217;s talk about what I was able to see, shall we?</p>
<p><span id="more-500"></span></p>
<h3>Is that a Chrome skin or what?</h3>
<p>Looks like FF took a page out of Chrome&#8217;s playbook, cause there are a lot of similarities. I actually really dig the look, which you can see in the image below. Granted, there is not much to see, because there are no plug-ins installed, but you get the idea. The icons are what I noticed first, and that is why I draw the Chrome likeness. If anything, it looks more sleek than it ever has. As far as speed though, I couldn&#8217;t tell if there was an increase or not. Since this is a beta though, I&#8217;ll leave final judgements for when the official release comes out.</p>
<div class="center">
<img src="http://www.jc-designs.net/newimages/blogImages/ff4preview.jpg" alt="Firefox 4 Beta" />
</div>
<h3>Tabs, tabs, tabs!</h3>
<p>I was disappointed to see that in this beta version that Tab Candy hasn&#8217;t been put in, cause that is one of the things I really wanted to check out. It works basically like Apple&#8217;s Expose, but with some cool additions. Tab Candy lets you view all your open tabs in one window (you see them as thumbnails), and choose which one you want to pull up. You can also drag n&#8217; drop them into groups so that you have seperate tab groups you can open at one time&#8230;very handy if you are like me and have more than 10 tabs open at a time. Oh, and they are now at the top of the browser window, but that can be changed to look more like they do now, if for some reason you preferred that.</p>
<p>You can also make any tab into what they call an App Tab, which basically puts the tab to the front of the list, and instead of the title showing in the tab, it displays its favicon. I have also read that Tab Candy will do something special with tabs you turn into App Tabs, but never actually what that will be.</p>
<h3>Additional Features</h3>
<p>Well, one thing to note is that FF4 will have a built in Inspector like Chrome does. Let me tell you though, you will want to stick with Firebug. It is basically the poor man&#8217;s version of it, with very little info and ability. Pure crap if you ask me. It&#8217;s like they tried, but only because everyone else is adding one. I will take a gander that this is because they know everyone will use Firebug anyway, so why put in the time. I would prefer they just skipped this part.</p>
<p>There is a Heads Up Display under Tools now, which is basically another console type thing. You can view CSS Warnings, Errors, Network Info, Logs and what not. Doubt I will use that one, but its there. I&#8217;m guessing this is like Firebug&#8217;s console log. Didn&#8217;t really try it out much.</p>
<h3>CSS3 Transitions and Transform</h3>
<p>Ok, I checked out <a href="http://www.css-tricks.com">css-tricks.com</a> because I know his new redesign has CSS3 transitions and transform in it. Transitions pertaining to CSS properties seem to be working fine like color/padding/background changes, but moving things, say, to the left or right is a no go. Transform is also a no go, so no image flips in this build. I am not sure if they are going to include that or not. Sux if they do not.</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>
<h3>jQuery issue?</h3>
<p>If you look back to the image above, you will notice the yellow cog in my logo in the middle of being animated. That is not just a screen capture misfire. That is actually what it looks like as it moves across the screen. I have no idea what is going on there, and I won&#8217;t know until the official release comes out. Hopefully it is because FF4 Beta is still being worked on. If not, I am a little scared, because I am not really doing anything fancy with that script. We shall see. Just wanted you to know what I saw. Everything else seemed to work ok though.</p>
<h3>In conclusion&#8230;</h3>
<p>I like what I saw and I look forward to the release of Firefox 4. The tests seem to show that the javascript engine is much faster, though not as fast as Chrome 6 Beta, Safari 5 or Opera. I believe even the IE9 build at the moment is better. If you have been able to play a little in any of the new Beta&#8217;s, let me know what you thought. I opened up the IE9 preview, but that is all it was, not an actual full working browser. Be aware though that IE9 will not work on XP.</p>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=500" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/08/firefox-4-beta-review-a-quick-look/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

