<?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"
	>

<channel>
	<title>Andrew Sellick &#187; JavaScript</title>
	<atom:link href="http://www.andrewsellick.com/category/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.andrewsellick.com</link>
	<description>andrewsellick.com</description>
	<pubDate>Sat, 23 Aug 2008 18:11:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>JavaScript Clone Object Function</title>
		<link>http://www.andrewsellick.com/93/javascript-clone-object-function</link>
		<comments>http://www.andrewsellick.com/93/javascript-clone-object-function#comments</comments>
		<pubDate>Thu, 20 Mar 2008 15:15:24 +0000</pubDate>
		<dc:creator>andy</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/93/javascript-clone-object-function</guid>
		<description><![CDATA[Here&#8217;s a pretty useful function that clones objects with the use of recursion allowing deep cloning:
function cloneObj(o) {
&#160;&#160; &#160; if(typeof(o) != &#8216;object&#8217;) return o;
&#160;&#160; &#160; if(o == null) return o;
&#160; &#160;
&#160;&#160; &#160; var newO = new Object();
&#160; &#160;
&#160;&#160; &#160; for(var i in o) newO[i] = cloneObj(o[i]);
&#160;&#160;&#160;&#160;&#160; return newO;
&#160;}

&#160;
Original source snipplr.com.
]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a pretty useful function that clones objects with the use of recursion allowing deep cloning:</p>
<div style="float: left;" class="code">function cloneObj(o) {<br />
&nbsp;&nbsp; &nbsp; if(typeof(o) != &#8216;object&#8217;) return o;<br />
&nbsp;&nbsp; &nbsp; if(o == null) return o;<br />
&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp; var newO = new Object();<br />
&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp; for(var i in o) newO[i] = cloneObj(o[i]);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return newO;<br />
&nbsp;}</div>
<p></p>
<div class="clear-both">&nbsp;</div>
<p>Original source <a href="http://snipplr.com/view/3357/clone/" target="_blank">snipplr.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/93/javascript-clone-object-function/feed</wfw:commentRss>
		</item>
		<item>
		<title>JavaScript GUID Generator</title>
		<link>http://www.andrewsellick.com/92/javascript-guid-generator</link>
		<comments>http://www.andrewsellick.com/92/javascript-guid-generator#comments</comments>
		<pubDate>Wed, 19 Mar 2008 12:37:40 +0000</pubDate>
		<dc:creator>andy</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/92/javascript-guid-generator</guid>
		<description><![CDATA[I recently found an interesting forum post which detailed how to generate GUIDs using JavaScript on the fly.&#160; Its very simple and looks as follows:
function S4() {
&#160;&#160; &#160;return (((1+Math.random())*0&#215;10000)&#124;0).toString(16).substring(1);
}
function generateGuid(){
&#160;&#160; &#160;&#160;&#160; &#160;return (S4()+S4()+&#34;-&#34;+S4()+&#34;-&#34;+S4()+&#34;-&#34;+S4()+&#34;-&#34;+S4()+S4()+S4()).toUpperCase();
}
&#160;

Originally posted by&#160;						 						 							Dr John Stockton on thescripts.com.
]]></description>
			<content:encoded><![CDATA[<p>I recently found an interesting <a href="http://www.thoughts.com/forums/">forum</a> post which detailed how to generate GUIDs using JavaScript on the fly.&nbsp; Its very simple and looks as follows:</p>
<div style="float: left;" class="code">function S4() {<br />
&nbsp;&nbsp; &nbsp;return (((1+Math.random())*0&#215;10000)|0).toString(16).substring(1);<br />
}</p>
<p>function generateGuid(){<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return (S4()+S4()+&quot;-&quot;+S4()+&quot;-&quot;+S4()+&quot;-&quot;+S4()+&quot;-&quot;+S4()+S4()+S4()).toUpperCase();<br />
}</div>
<div class="clear-both">&nbsp;</div>
<p>
Originally posted by&nbsp;						 						 							Dr John Stockton on <a href="http://www.thescripts.com/forum/thread523253.html" target="_blank">thescripts.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/92/javascript-guid-generator/feed</wfw:commentRss>
		</item>
		<item>
		<title>HTML Forms on the fly</title>
		<link>http://www.andrewsellick.com/90/html-forms-on-the-fly</link>
		<comments>http://www.andrewsellick.com/90/html-forms-on-the-fly#comments</comments>
		<pubDate>Tue, 19 Feb 2008 22:45:01 +0000</pubDate>
		<dc:creator>andy</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/90/html-forms-on-the-fly</guid>
		<description><![CDATA[I have been looking about at form generators recently and I think it&#8217;s fair to say pForm have created one of the best. The generator offers many options including; theme/colour scheme selection, the choice of a multitude of field elements (from a textbox to a file upload) to add to your form, editable form and [...]]]></description>
			<content:encoded><![CDATA[<p>I have been looking about at form generators recently and I think it&#8217;s fair to say <a href="http://www.phpform.org/" target="_blank">pForm</a> have created one of the best. The generator offers many options including; theme/colour scheme selection, the choice of a multitude of field elements (from a textbox to a file upload) to add to your form, editable form and form field properties and finally ability to download your recently created form.</p>
<p>This is a really nice generator so if your interested have a look at <a href="http://www.phpform.org/formbuilder/index.php" target="_blank">pForm (HTML Forms on the fly)</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/90/html-forms-on-the-fly/feed</wfw:commentRss>
		</item>
		<item>
		<title>Script of the week</title>
		<link>http://www.andrewsellick.com/89/script-of-the-week-7</link>
		<comments>http://www.andrewsellick.com/89/script-of-the-week-7#comments</comments>
		<pubDate>Fri, 15 Feb 2008 14:51:15 +0000</pubDate>
		<dc:creator>andy</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/89/script-of-the-week-7</guid>
		<description><![CDATA[Script of the week this week goes to the CSS Text Wrapper.&#160;&#160; On the website they state &#34; 			The CSS Text Wrapper allows you to easily make HTML text wrap in shapes other than just a rectangle. 			You can make text wrap around curves, zig-zags, or whatever you want.  All you have to do [...]]]></description>
			<content:encoded><![CDATA[<p>Script of the week this week goes to the CSS Text Wrapper.&nbsp;&nbsp; On the website they state &quot; 			The CSS Text Wrapper allows you to easily make HTML text wrap in shapes other than just a rectangle. 			You can make text wrap around curves, zig-zags, or whatever you want.  All you have to do is draw the 			left and right edges below and then copy the generated code to your website&quot; and I have to say it is very impressive.</p>
<p>The site covers every angle from XHTML with inline CSS, to XHTML with external CSS styles and finally an unobtrusive JavaScript.&nbsp; This is all neatly created for you on the fly from the website by using their flash tool to sculpt your desired shape.</p>
<p><img width="200" height="210" align="left" src="http://www.andrewsellick.com/wp-content/uploads/Image/css-text-wrapper.gif" alt="" /></p>
<p>The image to the left shows just how effective this technique can be producing some superb shapes to enrich your sites design and layout.</p>
<p>Have a look for yourself at the <a target="_blank" href="http://www.csstextwrap.com/index.php">CSS Text Wrapper</a> and if your still not decided why not have a look at the <a target="_blank" href="http://www.csstextwrap.com/examples.php">CSS Text Wrapper demo</a> page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/89/script-of-the-week-7/feed</wfw:commentRss>
		</item>
		<item>
		<title>JavaScript Table Row Highlighter Class using Mootools</title>
		<link>http://www.andrewsellick.com/85/javascript-table-row-highlighter-class-using-mootools</link>
		<comments>http://www.andrewsellick.com/85/javascript-table-row-highlighter-class-using-mootools#comments</comments>
		<pubDate>Wed, 09 Jan 2008 20:22:14 +0000</pubDate>
		<dc:creator>andy</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Mootools]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/85/javascript-table-row-highlighter-class-using-mootools</guid>
		<description><![CDATA[Well Christmas has been and gone (I hope you all had a fantastic Christmas/New Year), and now it&#8217;s time to get back down to some work.
I have developed a simple little class to highlight table rows using Mootools and I thought I would share it with the world.
code
As you can see below the HTML code [...]]]></description>
			<content:encoded><![CDATA[<p>Well Christmas has been and gone (I hope you all had a fantastic Christmas/New Year), and now it&#8217;s time to get back down to some work.</p>
<p>I have developed a simple little class to highlight table rows using Mootools and I thought I would share it with the world.</p>
<h3>code</h3>
<p>As you can see below the HTML code is very basic and uses an ID to define the region which requires highlightling.&nbsp; In this example an ID of &quot;<span class="attribute-value">highlight</span>&quot; has been applied to the tbody.</p>
<p>Finally all that is left is to instantiate the &quot;tableHighlighter&quot; class using the ID of &quot;highlight&quot; to reference the table (or part of) required.</p>
<div class="code">&lt;table&gt;</p>
<p>&nbsp;&nbsp; &nbsp;&lt;thead&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;th&gt;One&lt;/th&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;th&gt;Two&lt;/th&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;th&gt;Three&lt;/th&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;th&gt;Four&lt;/th&gt;</p>
<p>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;th&gt;Five&lt;/th&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;th&gt;Six&lt;/th&gt;<br />
&nbsp;&nbsp; &nbsp;&lt;/thead&gt;<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp;&lt;tbody id=&quot;highlight&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;1&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;40cm&lt;/td&gt;</p>
<p>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;Quaterfold&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;100&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;a href=&quot;#&quot;&gt;1000&lt;/a&gt;&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;3346005&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;1&lt;/td&gt;</p>
<p>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;40cm&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;Quaterfold&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;100&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;a href=&quot;#&quot;&gt;1000&lt;/a&gt;&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;3346005&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;</p>
<p>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;1&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;40cm&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;Quaterfold&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;100&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;a href=&quot;#&quot;&gt;1000&lt;/a&gt;&lt;/td&gt;</p>
<p>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;3346005&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;1&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;40cm&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;Quaterfold&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;100&lt;/td&gt;</p>
<p>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;a href=&quot;#&quot;&gt;1000&lt;/a&gt;&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;3346005&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;1&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;40cm&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;Quaterfold&lt;/td&gt;</p>
<p>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;100&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;a href=&quot;#&quot;&gt;1000&lt;/a&gt;&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;3346005&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;1&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;40cm&lt;/td&gt;</p>
<p>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;Quaterfold&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;100&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;a href=&quot;#&quot;&gt;1000&lt;/a&gt;&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;3346005&lt;/td&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br />
&nbsp;&nbsp; &nbsp;&lt;/tbody&gt;<br />
&nbsp;&nbsp; &nbsp;</p>
<p>&lt;/table&gt;</p>
<p>&lt;script type=&quot;text/javascript&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp;var th = new tableHighlighter( &#8216;highlight&#8217; );<br />
&nbsp;&nbsp; &nbsp;<br />
&lt;/script&gt;</div>
<h3>class options</h3>
<p>The Hightlighter class comes with several options built in to allow for easy customisation.&nbsp; These include:</p>
<ul>
<li>     rowColourClass - Can be named as you wish and referenced through css to produce your desired results.     </li>
<li>     rowHoverColourClass - Can be named as you wish and referenced through css to produce your desired results.     </li>
<li>     highlightRow - odd or even     </li>
</ul>
<p>
An example of how this could be used is as follows:</p>
<div class="code">&lt;script type=&quot;text/javascript&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp;var th = new tableHighlighter( &#8216;highlight&#8217;, {highlightRow: &#8216;odd&#8217;, rowColourClass: &#8216;myRowClassOne&#8217;, rowHoverColourClass: &#8216;myRowHoverClassTwo&#8217;} );<br />
&nbsp;&nbsp; &nbsp;<br />
&lt;/script&gt;</div>
<h3>mootools modules<br />
</h3>
<p>The modules required for this class is as follows:</p>
<p><strong>Core</strong></p>
<ul>
<li>Core</li>
</ul>
<p><strong>Class</strong></p>
<ul>
<li>Class</li>
</ul>
<p><strong>Native<br />
</strong></p>
<ul>
<li>Array</li>
<li>String</li>
<li>Function</li>
<li>Number</li>
<li>Element</li>
</ul>
<p><strong>Element<br />
</strong></p>
<ul>
<li>Element.Event</li>
</ul>
<h3>download</h3>
<p>Please feel free to download the <a href="http://www.andrewsellick.com/examples/tableHighlighter/tableHighlighter.rar">JavaScript Table Row Highlighter code</a>.</p>
<h3>demo</h3>
<p>Have a look for yourself at the <a target="_blank" href="http://www.andrewsellick.com/examples/tableHighlighter/">JavaScript Table Row Highlighter demo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/85/javascript-table-row-highlighter-class-using-mootools/feed</wfw:commentRss>
		</item>
		<item>
		<title>JavaScript Request Querystring Function</title>
		<link>http://www.andrewsellick.com/82/javascript-request-querystring-function</link>
		<comments>http://www.andrewsellick.com/82/javascript-request-querystring-function#comments</comments>
		<pubDate>Sun, 09 Dec 2007 17:32:34 +0000</pubDate>
		<dc:creator>andy</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/82/javascript-request-querystring-function</guid>
		<description><![CDATA[After searching for some time for a good request querystring solution, for JavaScript, I believe I have finally found it.
Netlobo.com have developed a very useful function that breaks the querystring up into parameters using regular expressions.&#160; This enables you to request the individual parameter you require and with very little added weight on the the [...]]]></description>
			<content:encoded><![CDATA[<p>After searching for some time for a good request querystring solution, for JavaScript, I believe I have finally found it.</p>
<p>Netlobo.com have developed a very useful function that breaks the querystring up into parameters using regular expressions.&nbsp; This enables you to request the individual parameter you require and with very little added weight on the the load time of the page as the code is only 11 lines in total.</p>
<p>Check ou the <a href="http://www.netlobo.com/url_query_string_javascript.html" target="_blank">JavaScript Request Quesrystring function</a> for yourself.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/82/javascript-request-querystring-function/feed</wfw:commentRss>
		</item>
		<item>
		<title>Simple 3D JavaScript Engine</title>
		<link>http://www.andrewsellick.com/76/simple-3d-javascript-engine</link>
		<comments>http://www.andrewsellick.com/76/simple-3d-javascript-engine#comments</comments>
		<pubDate>Tue, 06 Nov 2007 15:21:06 +0000</pubDate>
		<dc:creator>andy</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/76/simple-3d-javascript-engine</guid>
		<description><![CDATA[Carrying on from the theme of developing 3d effects in JavaScript I decided to keep researching flash examples and tutorials, trying to recode them into JavaScript.  I was then pointed to another really handy website that has some superb flash examples.
Kirupa had one demo in particular that I wanted to see if I could [...]]]></description>
			<content:encoded><![CDATA[<p>Carrying on from the theme of developing 3d effects in JavaScript I decided to keep researching flash examples and tutorials, trying to recode them into JavaScript.  I was then pointed to another really handy website that has some superb flash examples.</p>
<p><a target="_blank" href="http://www.kirupa.com/developer/actionscript/shape_camera.htm">Kirupa</a> had one demo in particular that I wanted to see if I could emulate called Scripting 3D in Flash.  This example showed how to create a camera movement in flash giving a feeling of perspective.</p>
<p>Having looked at the code I decided this was most definitely possible in JavaScript and here&rsquo;s what I came up with&hellip;</p>
<h3>code</h3>
<h4>HTML</h4>
<p>The HTML as seen below is pretty simplistic.&nbsp; Firstly we have a sceneContainer that wraps the whole 3D Engine, then we have a scene3D container which acts very much as a view for the the engine as will be described below and finally we have the individual images within the scene, each with an id allowing individual styling.</p>
<div class="code">&lt;div id=&quot;sceneContainer&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&lt;div id=&quot;scene3d&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;img src=&quot;director.png&quot; id=&quot;joe&quot; /&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;img src=&quot;director.png&quot; id=&quot;joe2&quot; /&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;img src=&quot;director.png&quot; id=&quot;joe3&quot; /&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;img src=&quot;director.png&quot; id=&quot;joe4&quot; /&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;img src=&quot;director.png&quot; id=&quot;joe5&quot; /&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;img src=&quot;director.png&quot; id=&quot;joe6&quot; /&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;img src=&quot;director.png&quot; id=&quot;joe7&quot; /&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;img src=&quot;director.png&quot; id=&quot;joe8&quot; /&gt;<br />
&nbsp;&nbsp; &nbsp;&lt;/div&gt;<br />
&lt;/div&gt;</div>
<h4>CSS</h4>
<p>The CSS details simple styling for the engine.&nbsp; Points to note are as follows:</p>
<ul>
<li>sceneContainer has a fixed width/height and an overflow of hidden.&nbsp; This allows us to mask the images as they move back and forth in perspective.</li>
<li>Next we have the scene3D positioned absolutely with a width of 100% of it&#8217;s container (sceneContainer).&nbsp; This allows for easy resizing and positioning of the container within the sceneContainer. 
    </li>
<li>Finally we have styles for each individual image within the containers.&nbsp; This allows us to position all the images within the scene3d container.</li>
</ul>
<div class="code">#sceneContainer{<br />
&nbsp;&nbsp; &nbsp;border:1px solid #CCCCCC;<br />
&nbsp;&nbsp; &nbsp;position:absolute;<br />
&nbsp;&nbsp; &nbsp;width:800px;<br />
&nbsp;&nbsp; &nbsp;height:500px;<br />
&nbsp;&nbsp; &nbsp;overflow:hidden;<br />
}</p>
<p>#scene3d{<br />
&nbsp;&nbsp; &nbsp;position:absolute;<br />
&nbsp;&nbsp; &nbsp;left:0%;<br />
&nbsp;&nbsp; &nbsp;width:100%;<br />
}</p>
<p>#joe{<br />
&nbsp;&nbsp; &nbsp;position:absolute;<br />
&nbsp;&nbsp; &nbsp;left:0px;<br />
}</p>
<p>#joe2{<br />
&nbsp;&nbsp; &nbsp;position:absolute;<br />
&nbsp;&nbsp; &nbsp;right:0px;<br />
}</p>
<p>#joe3{<br />
&nbsp;&nbsp; &nbsp;position:absolute;<br />
&nbsp;&nbsp; &nbsp;left:25%;<br />
}</p>
<p>#joe4{<br />
&nbsp;&nbsp; &nbsp;position:absolute;<br />
&nbsp;&nbsp; &nbsp;right:25%;<br />
}</p>
<p>#joe5{<br />
&nbsp;&nbsp; &nbsp;position:absolute;<br />
&nbsp;&nbsp; &nbsp;left:50%;<br />
}</p>
<p>#joe6{<br />
&nbsp;&nbsp; &nbsp;position:absolute;<br />
&nbsp;&nbsp; &nbsp;right:50%;<br />
}</p>
<p>#joe7{<br />
&nbsp;&nbsp; &nbsp;position:absolute;<br />
&nbsp;&nbsp; &nbsp;left:75%;<br />
}</p>
<p>#joe8{<br />
&nbsp;&nbsp; &nbsp;position:absolute;<br />
&nbsp;&nbsp; &nbsp;right:75%;<br />
}</div>
<h4>JavaScript</h4>
<p>Lastly we have the JavaScript.&nbsp; This is strongly based on the kirupa example and works by looping through the images included in the scene and scaling them based on the variables set in the movie.&nbsp; To achieve the effect of the images zooming in and out we also have to scale and reposition  the scene3D container at the same time hiding the overflow within the sceneContainer.</p>
<p>Have a play about with the variables to get to grips with how they control the effect and more over, have fun!</p>
<div class="code">var sceneContainer = document.getElementById(&#8217;sceneContainer&#8217;);<br />
var scene3d = document.getElementById(&#8217;scene3d&#8217;);</p>
<p>x = 0;<br />
y = 100;<br />
z = 300;</p>
<p>cameraView = new Object();<br />
cameraView.x = 0;<br />
cameraView.y = 0;<br />
cameraView.z = 500;</p>
<p>focalLength = 300;</p>
<p>dir = -1;<br />
speed = 20;</p>
<p>backAndForth = function(){<br />
&nbsp;&nbsp; &nbsp;cameraView.z += speed*dir;<br />
&nbsp;&nbsp; &nbsp;if (cameraView.z &gt; 500){<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;cameraView.z = 500;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;dir = -1;<br />
&nbsp;&nbsp; &nbsp;}else if (cameraView.z &lt; 0){<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;cameraView.z = 0;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;dir = 1;<br />
&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp;var sprites = scene3d.getElementsByTagName(&#8217;img&#8217;);<br />
&nbsp;&nbsp; &nbsp;var spritesLength = sprites.length;<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp;var scaleRatio = focalLength/(focalLength + z - cameraView.z);<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp;for( var i = 0; i &lt; spritesLength; i++ ){<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;var sprite = sprites[i];<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;sprite.style.top = ((y - cameraView.y) * scaleRatio)+&#8217;px&#8217;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;sprite.style.width = sprite.style.height = (100 * scaleRatio)+&#8217;px&#8217;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;scene3d.style.width = (100 * scaleRatio)+&#8217;%';<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;scene3d.style.left = &#8216;50%&#8217;;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;scene3d.style.marginLeft = &#8216;-&#8217;+(100 * scaleRatio)/2+&#8217;%';<br />
&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp;<br />
};<br />
setInterval(&#8217;backAndForth()&#8217;, 30);</div>
<h3>demo</h3>
<p>Have a look at the <a target="_blank" href="http://www.andrewsellick.com/examples/simple-3d-engine/">Simple 3D JavaScript Engine Demo</a>.</p>
<h3>download</h3>
<p>Feel free to download the <a target="_blank" href="http://www.andrewsellick.com/examples/simple-3d-engine/simple-3d-engine.rar">Simple 3D JavaScript Engine Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/76/simple-3d-javascript-engine/feed</wfw:commentRss>
		</item>
		<item>
		<title>Script of the week</title>
		<link>http://www.andrewsellick.com/74/script-of-the-week-6</link>
		<comments>http://www.andrewsellick.com/74/script-of-the-week-6#comments</comments>
		<pubDate>Fri, 19 Oct 2007 22:08:39 +0000</pubDate>
		<dc:creator>andy</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/74/script-of-the-week-6</guid>
		<description><![CDATA[Well this week I knew as soon as I found this script it had it in the bag.&#160; I have recently been searching for a good Flash 3D Carousel a found some amazing demos over at GOTOANDLEARN.COM which show you exactly how to achieve that effect, however, it then got me into thinking &#34;Has anybody [...]]]></description>
			<content:encoded><![CDATA[<p>Well this week I knew as soon as I found this script it had it in the bag.&nbsp; I have recently been searching for a good Flash 3D Carousel a found some amazing demos over at GOTOANDLEARN.COM which show you exactly how to achieve that effect, however, it then got me into thinking &quot;Has anybody created a JavaScript 3D Carousel?&quot;.&nbsp; Well the answer is yes&#8230;</p>
<p>Interface elements for jQuery have developed a really nice implementation of the <a href="http://interface.eyecon.ro/demos/carousel.html" target="_blank">3D Carousel</a> which is worth a look.&nbsp; An implementation guide can be found at <a href="http://interface.eyecon.ro/docs/carousel" target="_blank">Interface Elements</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/74/script-of-the-week-6/feed</wfw:commentRss>
		</item>
		<item>
		<title>Fancy Sliding Menu for Mootools</title>
		<link>http://www.andrewsellick.com/71/fancy-sliding-menu-for-mootools</link>
		<comments>http://www.andrewsellick.com/71/fancy-sliding-menu-for-mootools#comments</comments>
		<pubDate>Tue, 09 Oct 2007 20:19:39 +0000</pubDate>
		<dc:creator>andy</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Mootools]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/71/fancy-sliding-menu-for-mootools</guid>
		<description><![CDATA[ 
digg_url = "http://www.andrewsellick.com/71/fancy-sliding-menu-for-mootools";
 
&#160;

Due to the popularity of the script.aculo.us version of the Fancy Sliding Menu I decided a Mootools version was now in order.
It looks exactly the same as the the script.aculo.us, it works exactly the same as the script.aculo.us version, the only difference is it runs on Mootools.&#160;  
Right well thats [...]]]></description>
			<content:encoded><![CDATA[<div class="digg"> <script type="text/javascript">
digg_url = "http://www.andrewsellick.com/71/fancy-sliding-menu-for-mootools";
</script> <script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></p>
<p>&nbsp;</p>
</div>
<p>Due to the popularity of the script.aculo.us version of the <a href="http://www.andrewsellick.com/64/fancy-sliding-tab-menu-v2" target="_blank">Fancy Sliding Menu</a> I decided a Mootools version was now in order.</p>
<p>It looks exactly the same as the the script.aculo.us, it works exactly the same as the script.aculo.us version, the only difference is it runs on Mootools.&nbsp; <img src='http://www.andrewsellick.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Right well thats enough of the introductions, click on the demo and download the code below.</p>
<p>Have a look for yourselves and enjoy.</p>
<p><img width="500" height="187" src="http://www.andrewsellick.com/wp-content/uploads/Image/tabslide.jpg" alt="Fancy Sliding Tab Menu" /></p>
<h3>demo</h3>
<p>Feel free to view the <a target="_blank" href="http://www.andrewsellick.com/examples/tabslideV2-mootools/">Fancy Sliding Menu for Mootools demo</a>.</p>
<h3>download</h3>
<p>Please download the <a target="_blank" href="http://www.andrewsellick.com/examples/tabslideV2-mootools/tabslideV2-mootools.rar">Fancy Sliding Menu for Mootools code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/71/fancy-sliding-menu-for-mootools/feed</wfw:commentRss>
		</item>
		<item>
		<title>Script of the week</title>
		<link>http://www.andrewsellick.com/69/script-of-the-week-5</link>
		<comments>http://www.andrewsellick.com/69/script-of-the-week-5#comments</comments>
		<pubDate>Thu, 04 Oct 2007 23:06:24 +0000</pubDate>
		<dc:creator>andy</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Prototype]]></category>

		<category><![CDATA[script.aculo.us]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/69/script-of-the-week-5</guid>
		<description><![CDATA[It&#8217;s been a while since I last posted a script of the week, however, as soon as I found this script I knew I had to put it on my site.&#160; Well this week it is a script called LightWindow that claims the prize.&#160; Before you all moan at yet another light-&#8217;whatever&#8217; as it is [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I last posted a script of the week, however, as soon as I found this script I knew I had to put it on my site.&nbsp; Well this week it is a script called <a href="http://stickmanlabs.com/lightwindow/" target="_blank">LightWindow</a> that claims the prize.&nbsp; Before you all moan at yet another light-&#8217;whatever&#8217; as it is so well put on the LightWindow site please read on as this one is really worth a look.</p>
<p>Now I have seen a lot of LightBox esq effects out there but this one wins the prize.  Not for aesthetics as on that front it is just the same as the others, however, if you look at the media types that LightWindow is compatible with you gain an understanding as to why exactly it is that this script is so impressive (In fact LightWindow claims to support every media type).  Couple this with superior Browser compatibility and the sheer versatility and flexibility and you have a winning package.</p>
<p>The code is slightly heavy at 63KB and when taking in to account that it also uses Prototype and Script.aculo.us you can gather that it is a big bit of kit, however, the scalability of this code leads me to believe it is totally worth it.</p>
<p>Finally the list of features that LightWindow offers is phenomenal and well worth a browse.  Have a look for your self at the <a href="http://stickmanlabs.com/lightwindow/#features" target="_blank">LightWindow feature list</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/69/script-of-the-week-5/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.875 seconds -->
