<?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>Andrew Sellick &#187; XHTML</title>
	<atom:link href="http://www.andrewsellick.com/category/xhtml/feed" rel="self" type="application/rss+xml" />
	<link>http://www.andrewsellick.com</link>
	<description>andrewsellick.com</description>
	<lastBuildDate>Tue, 09 Jun 2009 13:29:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Outlook 2007 Conditional Comments</title>
		<link>http://www.andrewsellick.com/137/outlook-2007-conditional-comments</link>
		<comments>http://www.andrewsellick.com/137/outlook-2007-conditional-comments#comments</comments>
		<pubDate>Sat, 15 Nov 2008 00:35:18 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/?p=137</guid>
		<description><![CDATA[I recently wrote an article detailing best practices for HTML email templates and I thought I would add one more item to the list.  Conditional comments have saved me to many times for me to remember when building websites but I never thought they could help when building email templates, how wrong could I be.
For [...]]]></description>
			<content:encoded><![CDATA[<p>I recently wrote an article detailing best practices for HTML email templates and I thought I would add one more item to the list.  Conditional comments have saved me to many times for me to remember when building websites but I never thought they could help when building email templates, how wrong could I be.</p>
<p>For those of you that have attempted to implement an email template with a vaguely complex design in Outlook 2007 you will have hit many stumbling blocks with simple CSS attributes such as &#8220;background images&#8221; and &#8220;display&#8221;, to name but a few, not supported.  Getting these templates as close to the original design as possible in all email clients whilst also offer a slightly degraded, yet more than acceptable version for Outlook 2007, is a very tricky and time consuming business.  This is where conditional comments come in to play, as the example shows below:</p>
<pre class="code">&lt;!--[if gte mso 9]&gt;
	<span>Add your Outlook 2007 specific code here...</span>
&lt;![endif]--&gt;</pre>
<p>The above code snippet provides a much needed means to target Outlook 2007 specifically with styles and code to produce the degradation required to allow HTML templates to display correctly in such an awkward email client.</p>
<p>I would say long live conditional comments, however, I think I will take another tact, please please please Microsoft address Outlook&#8217;s support for CSS and for pity sake use the IE rendering engine and not MS Words.  You have the market leading browser so use it&#8230; [Rant ends]  <img src='http://www.andrewsellick.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/137/outlook-2007-conditional-comments/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>HTML email template best practices</title>
		<link>http://www.andrewsellick.com/117/html-email-template-best-practices</link>
		<comments>http://www.andrewsellick.com/117/html-email-template-best-practices#comments</comments>
		<pubDate>Fri, 31 Oct 2008 13:49:18 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/?p=117</guid>
		<description><![CDATA[Every so often I am required to build email templates and am constantly amazed by the new and bizarre bugs I come across.  Having worked my way through a mountain of email client “features” over the years I thought it would be good to put together a simple best practice guide to building an [...]]]></description>
			<content:encoded><![CDATA[<p>Every so often I am required to build email templates and am constantly amazed by the new and bizarre bugs I come across.  Having worked my way through a mountain of email client “features” over the years I thought it would be good to put together a simple best practice guide to building an email template.</p>
<h3>Best Practice</h3>
<ul>
<li>Use tables to provide positioning and layout as this will provide the greatest levels of consistency cross browser.  In many cases the simpler the code the better.</li>
</ul>
<ul>
<li>Inline styles should be used to create the desired creative effect again to reduce the risk of cross browser inconsistencies.I.e.
<pre>&lt;span style="color:#000000;"&gt;</pre>
</li>
</ul>
<ul>
<li>Apply fixed pixel sizes for font sizes and height/widths.</li>
</ul>
<ul>
<li>Use span tags with inline styles instead of p, h1 tags etc.  Most browsers apply natural padding and margin to p, h1 tags, so by using span tags you can eliminate this as a factor.</li>
</ul>
<ul>
<li>Avoid shorthand – some email clients have a habit of removing shorthand and replacing with the longhand equivalent (and doing it very badly).  It’s therefore much easier to take away the risk of this happening and only using longhand from the start.I.e.
<pre>&lt;span style="margin-top:10px;display:block;"&gt;testing&lt;/span&gt;</pre>
<p>instead of:</p>
<pre>&lt;span style="margin:10px 0px 0px 0px;display:block;"&gt;testing&lt;/span&gt;</pre>
</li>
</ul>
<ul>
<li>Use the table background attribute to apply background images instead of using CSS.  This is the most universal approach, however, it is worth remembering that Outlook 2007 does not allow background images at all.I.e.
<pre>&lt;table cellpadding="0" cellspacing="0" border="0" background="http://www.mydomain.com/images/email-010101/myimage.gif"&gt;
    &lt;tr&gt;
        &lt;td&gt;
            Content here
        &lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;</pre>
</li>
</ul>
<ul>
<li>If background images are used, apply a background colour to provide the same colour styling as the bg image.  This will provide structre to email clients that do not render background images.</li>
<li>Where an image is inserted apply an inline style of display block.  This removes extra margin applied in Windows Live Hotmail through Firefox.</li>
</ul>
<ul>
<li>Reference images on a live server.  This will help reduce the weight of the email as well as decreasing the risk of your template being picked up as spam as spammers have like to embed images into emails.</li>
</ul>
<ul>
<li>Images and text must be used in proportion again to avoid the risk of being picked up as spam.  Spammers like to include the message of their email in images to avoid email filters recognising blacklisted words.</li>
</ul>
<ul>
<li>Although JavaScript does work in some email clients its coverage is by know means complete.  Until there is better wide spread support JavaScript should not be used.</li>
</ul>
<ul>
<li>Forms should not be used within an email template.  As with JavaScript,there is support in some email clients but not all so they are best avoided.</li>
</ul>
<ul>
<li>Do not heavily nest tables within tables as older email clients such as Lotus Notes do not like it.</li>
</ul>
<h3>Useful Links</h3>
<p>The Campaign Monitor blog has some very helpful CSS support guides for different email clients.  Very interesting and well worth a read as it can save you a great deal of time in the long run.</p>
<p>- <a href="http://www.campaignmonitor.com/css/" target="_blank">Visit Campaign Monitor</a></p>
<p>The Email Standards site “helps designers understand why web standards are so important for email, while working with email client developers to ensure that emails render consistently”.  Another good read with some very helpful information.</p>
<p>- <a href="http://www.email-standards.org/ " target="_blank">Visit the Email Standards</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/117/html-email-template-best-practices/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Flash Movies as Backgrounds</title>
		<link>http://www.andrewsellick.com/95/flash-movies-as-backgrounds</link>
		<comments>http://www.andrewsellick.com/95/flash-movies-as-backgrounds#comments</comments>
		<pubDate>Mon, 13 Oct 2008 21:26:30 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Flash Links]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/?p=95</guid>
		<description><![CDATA[Ever wondered how to set a flash movie as your website background? Well here&#8217;s a simple approach that can be used.
The following tutorial will guide you through the process of &#8220;layering&#8221; a page in a way to give the appearance of a flash background.
The are however a couple of points that are worth noting.  These [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wondered how to set a flash movie as your website background? Well here&#8217;s a simple approach that can be used.</p>
<p>The following tutorial will guide you through the process of &#8220;layering&#8221; a page in a way to give the appearance of a flash background.</p>
<p>The are however a couple of points that are worth noting.  These include:</p>
<ul>
<li>Absolute positioning is used to add content above the flash movie.  This therefore mean that the content is taken out of the flow of the document and when resizing the page content may be cut off unless a good workaround is used.</li>
<li>UFO (Unobtrusive Flash Objects) is used to embed the flash background although you could, and probably should, use <a target="_blank">SWFObject</a> instead.</li>
</ul>
<h3>flash background HTML</h3>
<p>The HTML below provides a simple structure and can be broken in to two sections, a div with id &#8220;flash-background&#8221; (used to house the flash background) and a second div with an id of &#8220;website&#8221; (contains your site content).</p>
<div class="code">&lt;div id=&#8221;flash-background&#8221;&gt;&lt;/div&gt;<br />
&lt;div id=&#8221;website&#8221;&gt;<br />
&lt;div class=&#8221;text-content&#8221;&gt;<br />
&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras porta sem et ligula. Nunc nec neque. Ut nec justo non lorem porttitor dictum. Etiam nec dui et odio egestas ornare. Quisque magna augue, tristique vel, egestas ac, lacinia et, purus. Curabitur varius. Sed tempor. Integer bibendum leo at urna. Ut tortor. Cras lobortis justo non lacus.&lt;/p&gt;</p>
<p>&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras porta sem et ligula. Nunc nec neque. Ut nec justo non lorem porttitor dictum. Etiam nec dui et odio egestas ornare. Quisque magna augue, tristique vel, egestas ac, lacinia et, purus. Curabitur varius. Sed tempor. Integer bibendum leo at urna. Ut tortor. Cras lobortis justo non lacus.&lt;/p&gt;</p>
<p>&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras porta sem et ligula. Nunc nec neque. Ut nec justo non lorem porttitor dictum. Etiam nec dui et odio egestas ornare. Quisque magna augue, tristique vel, egestas ac, lacinia et, purus. Curabitur varius. Sed tempor. Integer bibendum leo at urna. Ut tortor. Cras lobortis justo non lacus.&lt;/p&gt;</p>
<p>&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras porta sem et ligula. Nunc nec neque. Ut nec justo non lorem porttitor dictum. Etiam nec dui et odio egestas ornare. Quisque magna augue, tristique vel, egestas ac, lacinia et, purus. Curabitur varius. Sed tempor. Integer bibendum leo at urna. Ut tortor. Cras lobortis justo non lacus.&lt;/p&gt;</p>
<p>&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras porta sem et ligula. Nunc nec neque. Ut nec justo non lorem porttitor dictum. Etiam nec dui et odio egestas ornare. Quisque magna augue, tristique vel, egestas ac, lacinia et, purus. Curabitur varius. Sed tempor. Integer bibendum leo at urna. Ut tortor. Cras lobortis justo non lacus.&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;</p>
</div>
<h3>flash background CSS</h3>
<p>The CSS below is not very complex.  Set your default styling on the body I.e. font size, colour etc. The flash background div is positioned absolutely in the centre of the page with a z-index of 0 and website div is also positioned in the centre of the page with a z-index of 10000 (obviously doesn&#8217;t have to be that high I just wanted to show that it was larger <img src='http://www.andrewsellick.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ).  CSS wise that is it, not very difficult at all.</p>
<div class="code">body{<br />
margin:0px;<br />
padding:0px;<br />
background-color:#666666;<br />
font-family:arial;<br />
font-size:80%;<br />
color:#333333;<br />
overflow:hidden;<br />
}<br />
#flash-background{<br />
width:1014px;<br />
height:960px;<br />
text-align:left;<br />
margin:0px auto;<br />
position:absolute;<br />
top:0px;<br />
left:50%;<br />
margin-left:-507px;<br />
z-index:0;<br />
}</p>
<p>#website{<br />
width:800px;<br />
height:400px;<br />
text-align:left;<br />
margin:30px auto;<br />
position:relative;<br />
z-index:10000;<br />
background-image:url(images/overlay.png);<br />
background-repeat:no-repeat;<br />
}</p>
<p>.text-content{<br />
padding:15px;<br />
}</p>
</div>
<h3>JavaScript</h3>
<p>Finally we need to embed the flash movie into the page, in the example below I have used UFO, however, I would strongly advise you to use SWFObject 2.0 as this is currently the best solution in the market.</p>
<pre>var FO = { movie:"flash/background.swf", width:"1014", height:"960", majorversion:"8", build:"0", xi:"true", wmode:"transparent" };
UFO.create(FO, "flash-background");
</pre>
<h3>demo</h3>
<p class="note"><a href="http://www.andrewsellick.com/examples/flash-background/" target="_blank">Flash background demo</a>.</p>
<h3>download</h3>
<p class="download"><a href="http://www.andrewsellick.com/examples/flash-background/flash-background.rar" target="_blank">Flash background download</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/95/flash-movies-as-backgrounds/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Advance Vista Styled CSS Menu</title>
		<link>http://www.andrewsellick.com/94/advance-vista-styled-css-menu</link>
		<comments>http://www.andrewsellick.com/94/advance-vista-styled-css-menu#comments</comments>
		<pubDate>Wed, 26 Mar 2008 14:37:49 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/94/advance-vista-styled-css-menu</guid>
		<description><![CDATA[ 
digg_url = "http://www.andrewsellick.com/94/advance-vista-styled-css-menu";
 
&#160;

After seeing an amazing design tutorial on PSDTUTS for a Vista Style menu design a decided to give it ago and turn their design into reality.&#160; Well I&#8217;ve built it and it looks pretty good (see the css vista menu demo) so I thought I would share how I did it [...]]]></description>
			<content:encoded><![CDATA[<div class="digg"> <script type="text/javascript">
digg_url = "http://www.andrewsellick.com/94/advance-vista-styled-css-menu";
</script> <script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></p>
<p>&nbsp;</p>
</div>
<p>After seeing an amazing design tutorial on PSDTUTS for a <a href="http://psdtuts.com/interface-tutorials/how-to-create-a-stunning-vista-inspired-menu/" target="_blank">Vista Style menu design</a> a decided to give it ago and turn their design into reality.&nbsp; Well I&#8217;ve built it and it looks pretty good (see the <a href="http://www.andrewsellick.com/examples/vista-menu/">css vista menu demo</a>) so I thought I would share how I did it with the world.</p>
<p><img width="258" height="42" alt="Advanced CSS Menu" src="http://www.andrewsellick.com/wp-content/uploads/Image/vista.gif" /></p>
<h3>step one</h3>
<p>Create a PSD of the menu as details in the PSDTUTS article linked above.</p>
<h3>step two</h3>
<p>Cut out the images required for the menu design and save them to an images folder at the root of your site.&nbsp; The required images are as follows:</p>
<ul>
<li>A one pixel wide image of the background of the menu. (nav-bg.gif)</li>
<li>A one pixel wide image of the divider (bar) that splits each nav item. (nav-bar.gif)</li>
<li>An active state image with the blue glow. Notice this image also has a divider (bar) on the left hand side of this image. This will be important for later on in this tutorial. (active.gif)</li>
</ul>
<p><img width="370" height="104" alt="CSS Vista Menu" src="http://www.andrewsellick.com/wp-content/uploads/Image/vista-items.gif" /></p>
<h3>step three</h3>
<p>Build the HTML structure:</p>
<div class="code">&lt;div id=&quot;main-nav&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&lt;ul&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;li class=&quot;active&quot;&gt;&lt;a href=&quot;#&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;One&lt;/a&gt;&lt;/li&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Two&lt;/a&gt;&lt;/li&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Three&lt;/a&gt;&lt;/li&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Four&lt;/a&gt;&lt;/li&gt;<br />
&nbsp;&nbsp; &nbsp;&lt;/ul&gt;<br />
&nbsp;&nbsp; &nbsp;&lt;div class=&quot;clear-both&quot;&gt;&amp;nbsp;&lt;/div&gt;<br />
&lt;/div&gt;</div>
<p>
As you can see above the structure is a simple unordered list of the desired navigation items, contained within a div named &quot;main-nav&quot;.</p>
<p>HTML wise that is it really.&nbsp; Just drop this in to the body of the site.</p>
<h3>step four</h3>
<p>Now we need to style the menu using the images we previously cut out as detailed below:</p>
<div class="code">body{<br />
&nbsp;&nbsp; &nbsp;font-family:Arial, Helvetica, sans-serif;<br />
&nbsp;&nbsp; &nbsp;font-size:75%;<br />
}</p>
<p>#main-nav{<br />
&nbsp;&nbsp;&nbsp; height:29px;<br />
&nbsp;&nbsp;&nbsp; float:left;<br />
&nbsp;&nbsp;&nbsp; background-image:url(../images/nav-bg.gif);<br />
&nbsp;&nbsp;&nbsp; background-repeat:repeat-x;<br />
&nbsp;&nbsp;&nbsp; background-position:top left;<br />
&nbsp;&nbsp;&nbsp; width:100%;<br />
}</div>
<p>
The code above sets the default font and font size for the body of the document.&nbsp; You can use whatever font you desire here or if you only want to apply these font styles to the menu add the font styling to the &quot;#main-nav&quot; style.</p>
<p>The &quot;#main-nav&quot; style sets the height/width of the menu whilst also applying the navigation background to the container.</p>
<div class="code">#main-nav ul,<br />
#main-nav li{<br />
&nbsp;&nbsp; &nbsp;padding:0px;<br />
&nbsp;&nbsp; &nbsp;margin:0px;<br />
&nbsp;&nbsp; &nbsp;list-style-type:none;<br />
}</div>
<p>
Next we need to remove the default padding/margin and bullets  applied to unordered lists.</p>
<div class="code">#main-nav ul{<br />
&nbsp;&nbsp; &nbsp;height:29px;<br />
&nbsp;&nbsp; &nbsp;line-height:29px;<br />
&nbsp;&nbsp; &nbsp;background-image:url(../images/nav-bar.gif);<br />
&nbsp;&nbsp; &nbsp;background-position:right;<br />
&nbsp;&nbsp; &nbsp;background-repeat:no-repeat;<br />
&nbsp;&nbsp; &nbsp;float:left;<br />
&nbsp;&nbsp; &nbsp;padding:0px 1px 0px 0px;<br />
&nbsp;&nbsp; &nbsp;margin:0px 0px 0px 10px;<br />
}</div>
<p>
Now we set the height of the ul tag to match the height applied to the &quot;#-main-nav&quot; container whilst also applying the nav divider (bar) image as the background of the ul, positioning it to the right hand side.&nbsp; Finally we float the ul left which gives a cross browse effect of width auto and pad the right hand side by 1px (This will allow room for the nav divider to show).</p>
<div class="code">#main-nav li{<br />
&nbsp;&nbsp; &nbsp;height:29px;<br />
&nbsp;&nbsp; &nbsp;line-height:29px;<br />
&nbsp;&nbsp; &nbsp;display:inline;<br />
&nbsp;&nbsp; &nbsp;position:relative;<br />
&nbsp;&nbsp; &nbsp;float:left;<br />
&nbsp;&nbsp; &nbsp;width:80px;<br />
&nbsp;&nbsp; &nbsp;text-align:center;<br />
}</div>
<p>
Next we set the height and width of the li tag and float it left forcing each li tag to sit inline with each other.&nbsp; In this example the width is fixed to 80px but this is very much up to you and your design.&nbsp;&nbsp; A line-height si also set to equal the applied height forcing the text to vertically align to the middle.</p>
<div class="code">#main-nav li a{<br />
&nbsp;&nbsp; &nbsp;height:29px;<br />
&nbsp;&nbsp; &nbsp;width:80px;<br />
&nbsp;&nbsp; &nbsp;text-align:center;<br />
&nbsp;&nbsp; &nbsp;float:left;<br />
&nbsp;&nbsp; &nbsp;background-image:url(../images/nav-bar.gif);<br />
&nbsp;&nbsp; &nbsp;background-position:left;<br />
&nbsp;&nbsp; &nbsp;background-repeat:no-repeat;<br />
}</div>
<p>
Now we need to style the &quot;a&quot; tag itself.&nbsp; Again it has been given the same width and height as the li tag and floated left.&nbsp; This makes sure the whole navigation item is clickable as well as to remove unwanted margins in IE 6.&nbsp; Next the nav divider (bar) image is added to each &quot;a&quot; tag to complete the dividing pipes look.</p>
<div class="code">#main-nav li a:link,<br />
#main-nav li a:visited{<br />
&nbsp;&nbsp; &nbsp;color:#FFFFFF;<br />
&nbsp;&nbsp; &nbsp;text-decoration:none;<br />
}</p>
<p>#main-nav li.active a,<br />
#main-nav li a:hover{<br />
&nbsp;&nbsp; &nbsp;background-image:url(../images/active.gif);<br />
&nbsp;&nbsp; &nbsp;background-repeat:no-repeat;<br />
&nbsp;&nbsp; &nbsp;background-position:left;<br />
}</div>
<p>
Finally we need to add the link styling and active/hover states.&nbsp; The text colour is set to white and link underline removed for all &quot;a&quot; tags and we apply the active image to the active class and &quot;a&quot; tag hover state.</p>
<p>Now all you need to do is check it out in your browser.&nbsp; Enjoy..</p>
<h3>demo</h3>
<p>Check out the <a href="http://www.andrewsellick.com/examples/vista-menu/">CSS Vista Menu Demo</a> for yourself.</p>
<h3>download</h3>
<p><a href="http://www.andrewsellick.com/examples/vista-menu/vista-menu.rar" target="_blank">Download the CSS Vista Menu</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/94/advance-vista-styled-css-menu/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</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 &#8211; 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 &#8211; 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>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple 3D Carousel using Mootools</title>
		<link>http://www.andrewsellick.com/75/simple-3d-carousel-using-mootools</link>
		<comments>http://www.andrewsellick.com/75/simple-3d-carousel-using-mootools#comments</comments>
		<pubDate>Wed, 31 Oct 2007 10:18:10 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Mootools]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/75/simple-3d-carousel-using-mootools</guid>
		<description><![CDATA[After researching a good method to create a 3D Carousel I came across two resources that intrigued me; firstly GOTOANDLEARN.com which provided an amazing flash 3D Carousel tutorial and then the jQuery 3D Carousel.

After having a play about with these two examples for a while it got me in to thinking, &#8220;how easy it would [...]]]></description>
			<content:encoded><![CDATA[<p>After researching a good method to create a 3D Carousel I came across two resources that intrigued me; firstly GOTOANDLEARN.com which provided an amazing flash 3D Carousel tutorial and then the jQuery 3D Carousel.</p>
<p><img width="309" height="122" alt="3D Carousel" src="http://www.andrewsellick.com/wp-content/uploads/Image/small-simple-3d-carousel.png" /></p>
<p>After having a play about with these two examples for a while it got me in to thinking, &ldquo;how easy it would it be to implement a 3D Carousel myself?&ldquo;</p>
<p>Well after carrying out some research and using the two above examples as a foundation I created a basic 3D Carousel.  This example will be the first instalment in which I demonstrate the basic Carousel and further more advanced tutorials will be added at a later date.</p>
<p>So here we go&hellip;</p>
<h3>code</h3>
<h4>html</h4>
<p>As can be seen below the HTML is very simple and consists of a main container wrapping several divs with images inside.&nbsp; That is all that is required at this stage from an html perspective.&nbsp; Obviously the number of images and the images themselves can be changed here.</p>
<div class="code">&lt;div id=&quot;carousel&quot;&gt;<br />
&nbsp;&nbsp; &nbsp;&lt;div&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;images/dreamweaver.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp;&lt;div&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;images/director.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp;&lt;div&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;images/flash.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp;&lt;div&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;images/freehand.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp;&lt;div&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;images/swf-player.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp;&lt;div&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;images/coldfusion.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;<br />
&lt;/div&gt;</div>
<h4>css</h4>
<p>The CSS is also very&nbsp; simple setting the style attributes for the main container as well as the images width and height within each of their containing divs.&nbsp; One point to note would be that the width and height of the carousel container should be edited as desired to meet your needs althoug further editing will be needed below as shown.</p>
<div class="code">&lt;style&gt;</p>
<p>&nbsp;&nbsp; &nbsp;#carousel{<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;background-color:#000000;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;width:700px;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;height:400px;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;position:relative;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;border:1px solid #FFFFFF;<br />
&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp; &nbsp;img{<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;width:100%;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;height:100%;<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;border:0px solid #FFFFFF;<br />
&nbsp;&nbsp; &nbsp;}<br />
&nbsp;&nbsp; &nbsp;<br />
&lt;/style&gt;</div>
<h4>JavaScript Variables</h4>
<p>This is where understanding is required to set up the carousel.  baseSpeed is the initial speed of the carousel, the higher the value the faster it will spin, radiusX and radiusY are the horizontal and vertical radiuses of the carousel so adjust these to effectively change the width and height.</p>
<p>centerX and centerY pinpoint the center of the accordion with in the main container.  These will need to be amended if the main containers width and height attributes are amended.</p>
<p>Finally speed is used in conjunction with baseSpeed to set the initial speed of the carousel, although, the speed will be altered depending on the position x of the mouse over the carousel container.</p>
<div class="code">var baseSpeed = 0.05; <br />
var radiusX = 190; <br />
var radiusY = 40; <br />
var centerX = 300; <br />
var centerY = 190;<br />
var speed = 0.3;
</div>
<h3>demo</h3>
<p>Have a look for yourself at the <a target="_blank" href="http://www.andrewsellick.com/examples/3d-carousel/">Simple 3D Carousel demo.</a></p>
<h3>download</h3>
<p>Feel free to download the <a target="_blank" href="http://www.andrewsellick.com/examples/3d-carousel/3d-carousel.rar">Simple 3D Carousel</a>.</p>
<h3>notes</h3>
<p>This is a very basic demo and as such should not be treated as a finished product.&nbsp; I&#8217;m using this article as more of a tutorial to create clear stages between the version above and a far more advanced version that I will release in the not to distant future.</p>
<p>I&#8217;m still looking to further improve the smoothness of the carousel and new features such as automatic image reflection and arrows to manually rotate the carousel will be added in future versions.</p>
<h3>mootools modules</h3>
<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>
<p><strong>Window<br />
</strong></p>
<ul>
<li>Window.DomReady</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/75/simple-3d-carousel-using-mootools/feed</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>YAML a HTML/CSS Template Builder</title>
		<link>http://www.andrewsellick.com/68/yaml-a-htmlcss-template-builder</link>
		<comments>http://www.andrewsellick.com/68/yaml-a-htmlcss-template-builder#comments</comments>
		<pubDate>Thu, 04 Oct 2007 13:27:32 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/68/yaml-a-htmlcss-template-builder</guid>
		<description><![CDATA[I was recently pointed in the direction of a very cool online app called YAML (&#34;Yet Another Multicolumn Layout&#34;) Builder.  It&#8217;s an online HTML template builder and I have to say it looks pretty good.  
Now as I am working on a template builder myself I thought a good place to start would [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently pointed in the direction of a very cool online app called <a href="http://builder.yaml.de/" target="_blank">YAML (&quot;Yet Another Multicolumn Layout&quot;) Builder</a>.  It&rsquo;s an online HTML template builder and I have to say it looks pretty good.  </p>
<p>Now as I am working on a template builder myself I thought a good place to start would be by reviewing the YAML builder and to decipher the positives and negatives of the application.  So here we go:</p>
<h3>aesthetics</h3>
<p>It has to be said the builder is very aesthetically pleasing with a simple yet satisfying design and very powerful interactive features allowing drag and drop components to help build the template as required.</p>
<h3>level of detail</h3>
<p>The level of detail at which you can manipulate your desired template is relatively high, however, if your looking to create a very complex template this builder is not for you.  Allowing only 0, 2 or 3 column layouts can be quite restrictive although it does allow you to add &ldquo;column sets&rdquo; to each column to produce a more precise layout, however, this is not always practical.</p>
<p>The ability to add padded content boxes, content elements (such as h1, h2, p, line, ul) and column sets really enhances the template builders appeal and definitely offers novice template builders a firm foundation from which they can build.</p>
<p>The level at which column and site widths can be edited also works very nicely.  The ability to set max and min widths, re-order columns and change the individual column widths add for a satisfying effect.</p>
<h3>conclusion</h3>
<p>It has to be said the YAML builder is well worth a look to see if it meets your needs.  More complex layouts may be a bridge too far for this builder, but I believe with a little extra development this app could be formidable.  It does have a very strong foundation, but I would like to see it support more columns and the integration of rows as well.  Then there is always the prospect of equal height columns to take it in to the exceptional bracket.</p>
<p>A lot to think about when considering my own template builder, but I can definitely use this as a firm benchmark from which I can weigh my own efforts against.</p>
<h3>update</h3>
<p>I have just received an email from Dirk Jesse (YAML Builder Developer) and he added the following to my review with regards to the level of complexity:</p>
<p>&quot;Check out the Subtemplates in the &quot;Add Elements&quot; section. These offer much higher flexibility (eg. columns and rows) and can be combined with the exisiting columns. You can also remove all columns and creatve your layout only with the subtemplates. They even can be nested. So, rather complex layouts are possible too.&quot;</p>
<p>Well I think that just about caps it off.&nbsp; What an awesome app.&nbsp; If anyone uses it let me know how you get on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/68/yaml-a-htmlcss-template-builder/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Simple JavaScript Idle State using Prototype</title>
		<link>http://www.andrewsellick.com/67/simple-javascript-idle-state-using-prototype</link>
		<comments>http://www.andrewsellick.com/67/simple-javascript-idle-state-using-prototype#comments</comments>
		<pubDate>Wed, 03 Oct 2007 13:17:29 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/67/simple-javascript-idle-state-using-prototype</guid>
		<description><![CDATA[This is a fairly simple piece of code, however, I decided it was worth putting up on the site for everybody to see.
Anyway the code itself aims to fire a function when there has been no mouse movement for a predefined length of time and reset the count every time the mouse is moved.
code
The code [...]]]></description>
			<content:encoded><![CDATA[<p>This is a fairly simple piece of code, however, I decided it was worth putting up on the site for everybody to see.</p>
<p>Anyway the code itself aims to fire a function when there has been no mouse movement for a predefined length of time and reset the count every time the mouse is moved.</p>
<h3>code</h3>
<p>The code is very simple, therefore, only the JavaScript is worth talking about for this example, so that is going to be the focus of this article.&nbsp; Have a look for yourself below.</p>
<p>Right then here we go:</p>
<h4>JavaScript<br />
</h4>
<div class="code">var idleTime&nbsp;&nbsp; &nbsp;= 5000;<br />
var timeOut&nbsp;&nbsp; &nbsp; = &#8221;;</p>
<p>function init() {<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp;&nbsp; Event.observe(document.body, &#8216;mousemove&#8217;, resetIdle, true);<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; setIdle();<br />
&nbsp;&nbsp;&nbsp; <br />
}</p>
<p>function onIdleFunction(){<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; alert(&#8217;Your browser has been idle for &#8216; + (idleTime/1000) +&#8217; seconds.&#8217;);<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />
}</p>
<p>function resetIdle(){<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; window.clearTimeout( timeOut );<br />
&nbsp;&nbsp;&nbsp; setIdle();<br />
&nbsp;&nbsp;&nbsp; <br />
}</p>
<p>function setIdle(){<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; timeOut = window.setTimeout( &quot;onIdleFunction()&quot;, idleTime );<br />
&nbsp;&nbsp;&nbsp; <br />
}</p>
<p>Event.observe(window, &#8216;load&#8217;, init, false); 
</div>
<p>
At the top of the code there is a variable called &quot;idleTime&quot;, this variable sets the idle state time (in milliseconds) that the browser mouse be idble for, before firing the function.&nbsp; Change this as you wish.</p>
<p>Next we have the &quot;init&quot; function which is called on page load by an event listener at the bottom of the sample code.&nbsp; This itself sets a mouse move event listener (which resets the idle state when fired) on the document body and also calls the idle state function.</p>
<p>We then have an &quot;onIdleFunction&quot; which is where you put the code you wish to be fired when the page is idle.&nbsp; In this example we&#8217;re just alerting out that the page has been idle.</p>
<p>Finally we have two functions, resetIdle and setIdle, which really do exactly what it says on the tin.&nbsp; The first resets the idle state (on mouse movement) and the second sets the idle state.</p>
<p>Well that&#8217;s about it so have a look for yourself at the demo and code below.</p>
<h3>demo</h3>
<p>Feel free to view the <a target="_blank" href="http://www.andrewsellick.com/examples/idleState/">Simple JavaScript Idle State using Prototype Demo</a>.</p>
<h3>download</h3>
<p>Also please have a look at the <a target="_blank" href="http://www.andrewsellick.com/examples/idleState/idleState.rar">Simple JavaScript Idle State using Prototype Code</a>.</p>
<h3>note</h3>
<p>The Idle State at present only uses mouse movement for detect inactivity.&nbsp; This will be problematic when considering devices that do not have mice (as it will not work), however, the code can be easily adapted to check for other forms of activity.</p>
<p>It is also worth while mentioning that the mouse move event is applied to the document body and therefore you must make sure that the height and width of the body and html are set to 100% for this to work, otherwise the event listener will not work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/67/simple-javascript-idle-state-using-prototype/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>HTML/CSS Liquid Layout Templates</title>
		<link>http://www.andrewsellick.com/58/htmlcss-liquid-layout-templates</link>
		<comments>http://www.andrewsellick.com/58/htmlcss-liquid-layout-templates#comments</comments>
		<pubDate>Sat, 04 Aug 2007 12:14:53 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/58/htmlcss-liquid-layout-templates</guid>
		<description><![CDATA[I have recently been working on building up a template collection as a base from which I can develop any site.&#160; I have finished off the Liquid layout templates and have decided to include them on my site under the tab layout at the top of the page.
Have a look for yourself at HTML/CSS Liquid [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently been working on building up a template collection as a base from which I can develop any site.&nbsp; I have finished off the Liquid layout templates and have decided to include them on my site under the tab layout at the top of the page.</p>
<p>Have a look for yourself at <a target="_blank" href="http://www.andrewsellick.com/layout-templates/">HTML/CSS Liquid Layout Templates</a> and let me know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/58/htmlcss-liquid-layout-templates/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Masking a Flash Movie in HTML using a DIV</title>
		<link>http://www.andrewsellick.com/46/masking-a-flash-movie-in-html-using-a-div</link>
		<comments>http://www.andrewsellick.com/46/masking-a-flash-movie-in-html-using-a-div#comments</comments>
		<pubDate>Wed, 20 Jun 2007 12:54:56 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Flash Links]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/46/masking-a-flash-movie-in-html-using-a-div</guid>
		<description><![CDATA[This is not something that is required in day to day development, but nether the less is definitely handy to know.
Due to the nature of embedded flash it does not seem possible to &#8220;mask&#8221; it using an overflow hidden on a containing DIV.  This however is not the case.
By simply adding the following parameters [...]]]></description>
			<content:encoded><![CDATA[<p>This is not something that is required in day to day development, but nether the less is definitely handy to know.</p>
<p>Due to the nature of embedded flash it does not seem possible to &ldquo;mask&rdquo; it using an overflow hidden on a containing DIV.  This however is not the case.</p>
<p>By simply adding the following parameters a flash movie can be masked:</p>
<div class="code"> &lt;param name=&quot;wmode&quot; value=&quot;transparent&quot; /&gt;</p>
<p>&lt;embed src=&quot;andrewsellick.swf&quot; quality=&quot;high&quot; wmode=&quot;transparent&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;550&quot; height=&quot;150&quot;&gt;&lt;/embed&gt;
</div>
<p>The wmode parameters bring the flash movie back into the flow of the document and therefore allow it to be treated as if it were for example an image.<br />
<br />
The complete code I have used in the example is as follows:</p>
<h3>code</h3>
<h4>css</h4>
<p></p>
<div class="code"> #flash-mask{<br />
width:30%;<br />
overflow:hidden;<br />
padding:10px 0px;<br />
border:1px solid #cccccc;<br />
}
</div>
<p>The CSS as shown above is very simple and sets a width on a containing DIV to 30% of the page width as well as having an overflow set to hidden.  This will simply demonstrate the effect clearly.</p>
<h4>html</h4>
<div class="code"> &lt;div id=&quot;flash-mask&quot;&gt;<br />
&lt;object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0&quot; width=&quot;550&quot; height=&quot;150&quot;&gt;<br />
&lt;param name=&quot;movie&quot; value=&quot;andrewsellick.swf&quot; /&gt;<br />
&lt;param name=&quot;quality&quot; value=&quot;high&quot; /&gt;<br />
&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot; /&gt; <br />
&lt;embed src=&quot;andrewsellick.swf&quot; quality=&quot;high&quot; wmode=&quot;transparent&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;550&quot; height=&quot;150&quot;&gt;&lt;/embed&gt;<br />
&lt;/object&gt;<br />
&lt;/div&gt;
</div>
<p>As can be seen above there isnothing special here.  Simply a containing DIV with a flash movie embeded and of course the parameters set.<br />
</p>
<h3>example</h3>
<p>Please have a look at the <a target="_blank" href="http://www.andrewsellick.com/examples/flash-mask/">Masking a Flash Movie in HTML using a DIV example.</a></p>
<h3>download</h3>
<p>Feel free to try it out yourself with the <a target="_blank" href="http://www.andrewsellick.com/examples/flash-mask/flash-mask.rar">Masking a Flash Movie in HTML using a DIV download.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/46/masking-a-flash-movie-in-html-using-a-div/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

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