<?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>Skylar Anderson &#187; jQuery</title>
	<atom:link href="http://goskylar.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://goskylar.com</link>
	<description>Web Design, Facebook Application Development, AJAX, User Interface &#124; Indianapolis, IN</description>
	<lastBuildDate>Thu, 23 Jul 2009 01:34:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Hyphenating Strings with jQuery</title>
		<link>http://goskylar.com/2009/07/hyphenating-strings-with-jquery/</link>
		<comments>http://goskylar.com/2009/07/hyphenating-strings-with-jquery/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 17:13:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[hyphenating]]></category>
		<category><![CDATA[jQuery Plugin]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://goskylar.com/?p=92</guid>
		<description><![CDATA[Over the course of the past couple weeks, my need for a method of string hyphenating DOM objects has arisen quite often. Any UI developer that has to deal with user input with limited space will know that this can be a big pain. Like a true software engineer, I searched the interwebs to see [...]]]></description>
			<content:encoded><![CDATA[<p>Over the course of the past couple weeks, my need for a method of string hyphenating DOM objects has arisen quite often.   Any UI developer that has to deal with user input with limited space will know that this can be a big pain.  Like a true software engineer, I searched the interwebs to see if there were any existing plugins to handle this for me.  Shockingly, I found no viable solutions, so I wrote my own jQuery Plugin to handle the hyphenating.</p>
<h3><a href="http://goskylar.com/wp-content/demos/jquery.hyphenate/">Jump to the jQuery Hyphenate Demo</a></h3>
<h3><a href="http://goskylar.com/wp-content/uploads/2009/07/jquery.hyphenate.zip">Download the Source Code</a></h3>
<p><strong>Requirements</strong></p>
<ul>
<li><a href="http://jquery.com">jQuery</a></li>
<li><a href="#">The jQuery.Hyphenate Plugin</a></li>
</ul>
<p>In the head of your document, be sure to include your references to the jQuery library and the Hyphenate Plugin:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">  &lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.hyphenate.js&quot;&gt;&lt;/script&gt;</pre></div></div>

<p>Following that, we can instantiate our plugin on any dom element:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// Document is ready</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.hyphen'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hyphenate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #006600; font-style: italic;">// Hyphenate all divs with a class of 'hyphen'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>By default, the plugin will hyphenate the strings based off the current width of the element we are hyphenating.  You can, however, pass in an optional oWidth parameter to define a width for the element.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// Document is ready</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.hyphen'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hyphenate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> oWidth <span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #006600; font-style: italic;">// Hyphenate all divs with a class of 'hyphen' to a width of 100px</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This plugin works best with block level elements (DIV, P, H1, LI), but can also work on inline elements (SPAN, EM, STRONG), just note that the plugin will modify them to block level via <em>display:block</em>.</p>
<h3>Known Issues</h3>
<p>This plugin is in its initial release, so please do not consider this a complete and polished plugin.</p>
<ul>
<li>Nested DOM elements will be removed.  If you are performing a hyphenation on a DIV that has child SPANs or As, then those elements will be removed, though there inner-text will remain.</li>
</ul>
<p>Please enjoy!  Feel free to leave comments and suggestions below, and don&#8217;t forget to come back often to check for updates.</p>
]]></content:encoded>
			<wfw:commentRss>http://goskylar.com/2009/07/hyphenating-strings-with-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>To die for image rollovers with jQuery Parallax</title>
		<link>http://goskylar.com/2009/07/to-die-for-image-rollovers-with-jquery-parallax/</link>
		<comments>http://goskylar.com/2009/07/to-die-for-image-rollovers-with-jquery-parallax/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 21:50:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Image Rollovers]]></category>
		<category><![CDATA[Sexy UI]]></category>

		<guid isPermaLink="false">http://goskylar.com/?p=66</guid>
		<description><![CDATA[The basic principal of parallax is the creation of an artificial 3D space through subtle movements on varying 2D planes.  Basically we can create a faux 3D environment with 2D elements.]]></description>
			<content:encoded><![CDATA[<p>The visual technique of <em>parallax</em> has been around computer graphics for some time.  The basic principal of parallax is the creation of an artificial 3D space through subtle movements on varying 2D planes.  Basically we can create a faux 3D environment with 2D elements.</p>
<p>Enough with the chit-chat.  Parallax can best be described by seeing it in action:<br />
<h3><a href="http://goskylar.com/wp-content/demos/jquery_parallax/">View the Parallax Demo</a></h3>
<p>Parallax is typically used for creating captivating 3d scenes and landscapes, but here we&#8217;ll use it just to create some really nice image rollovers.</p>
<h1>On with the tutorial</h1>
<p><strong>Requirements</strong></p>
<ul>
<li>Basic understanding of HTML/CSS</li>
<li>Basic understanding of creating PNG transparency</li>
<li><a href="http://jquery.com">jQuery</a></li>
<li><a href="http://webdev.stephband.info/parallax.html">jQuery &#8211; Parallax Plugin</a> by <a href="http://stephband.info/">Stephen Band</a></li>
</ul>
<p>Feel free to <a href="http://goskylar.com/wp-content/uploads/2009/07/parallax.zip">download the entire project here.</a></p>
<h3>Step 1. Design your image</h3>
<p>Using Photoshop, or your image editor of choice so long as it supports .PNG alpha transparency, create an interesting design including several elements.  You can create a scene like <a href="http://webdev.stephband.info/parallax.html">Stephen did</a> or something simple like my <a href="http://goskylar.com/wp-content/demos/jquery_parallax/">demo.</a></p>
<p>  Be sure to keep your design <strong>larger</strong> than you plan on using it in the final product.</p>
<div id="attachment_73" class="wp-caption alignnone" style="width: 510px"><img src="http://goskylar.com/wp-content/uploads/2009/07/step1.jpg" alt="jquery image rollover with parallax - step1" title="parallax_step1.jpg" width="500" height="500" class="size-full wp-image-73" /><p class="wp-caption-text">Image Rollovers with jQuery Parallax - Step 1</p></div>
<h3>Step 2. Set up your layers</h3>
<p>Now pull apart your document, creating a 24-bit PNG for each layer. In my example I made three layers:<br />
<strong>Layer 0 </strong> &#8211; The background: bg.png<br />
<strong>Layer 1 </strong> &#8211; The guides: guides.png<br />
<strong>Layer 2 </strong> &#8211; Text: name.png</p>
<p><img src="http://goskylar.com/wp-content/uploads/2009/07/Picture-1.png" alt="24-bit png transparency" title="24-bit png transparency" width="305" height="184" class="alignnone size-full wp-image-76" /></p>
<h3>Step 3. HTML</h3>
<p>Now, with a separate PNG for each layer in our parallax, we can create a new HTML document with the following code in the body.</p>

<div class="wp_syntax"><div class="code"><pre class="xhtml" style="font-family:monospace;">&lt;div id=&quot;parallax&quot;&gt;
        &lt;!-- Layer 0 // Background --&gt;
  	&lt;div style=&quot;width:500px; height:500px;&quot;&gt;
  		&lt;img src=&quot;bg.png&quot; alt=&quot;&quot; /&gt;
  	&lt;/div&gt;
&nbsp;
        &lt;!-- Layer 1 // Guides --&gt;
  	&lt;div style=&quot;width:500px; height:500px;&quot;&gt;
  		&lt;img src=&quot;guides.png&quot; alt=&quot;&quot; /&gt;
  	&lt;/div&gt;
&nbsp;
        &lt;!-- Layer 2 // Text --&gt;
  	&lt;div style=&quot;width:500px; height:500px;&quot;&gt;
  		&lt;img src=&quot;name.png&quot; alt=&quot;&quot;/&gt;
  	&lt;/div&gt;
 &lt;/div&gt;</pre></div></div>

<p>Set the size of each DIV equal to the size of the image it is holding.</p>
<h3>Step 4. CSS</h3>
<p>We use CSS to define the window in which our parallax will render.  Place the following rule in your stylesheet.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#parallax</span> <span style="color: #00AA00;">&#123;</span> 
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">400px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h3>Step 4. Make it come alive with jQuery</h3>
<p>In the head of your document, be sure to include the jQuery and jQuery.paralax libraries:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.3.2.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.jparallax.js&quot;&gt;&lt;/script&gt;</pre></div></div>

<p>Now we can add our jQuery:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>	
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#parallax'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">jparallax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">// Options</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	<span style="color: #009900;">&#123;</span>xtravel<span style="color: #339933;">:</span> <span style="color: #3366CC;">'30px'</span><span style="color: #339933;">,</span> ytravel<span style="color: #339933;">:</span> <span style="color: #3366CC;">'30px'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// Layer 0 : bg.png</span>
	<span style="color: #009900;">&#123;</span>xtravel<span style="color: #339933;">:</span> <span style="color: #3366CC;">'50px'</span><span style="color: #339933;">,</span> ytravel<span style="color: #339933;">:</span> <span style="color: #3366CC;">'60px'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// Layer 1 : guides.png</span>
	<span style="color: #009900;">&#123;</span>xtravel<span style="color: #339933;">:</span> <span style="color: #3366CC;">'200px'</span><span style="color: #339933;">,</span> ytravel<span style="color: #339933;">:</span> <span style="color: #3366CC;">'80px'</span><span style="color: #009900;">&#125;</span> <span style="color: #006600; font-style: italic;">// Layer 2 : name.png</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Each line of {options} creates a unique set of rules for that layer.  Reduce the xtravel/ytravel values in order to lessen the parallax effect.  Background layers <strong>move less</strong> than foreground layers so make sure their xtravel/ytravel values are smaller than foreground layers.  Feel free to tweak these numbers as you see fit.  jQuery Parallax supports a multitude of options, consult the <a href="http://webdev.stephband.info/parallax.html">plug-in page for more information</a>.</p>
<p>And that&#8217;s it!  You should have something very similar to <a href="http://goskylar.com/wp-content/demos/jquery_parallax/">my completed demo.</a>  If not, please post a comment or drop me an email and I can help you out.  Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://goskylar.com/2009/07/to-die-for-image-rollovers-with-jquery-parallax/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
