<?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>Design Chemical - Web Design, Printing, Packaging &#38; SEO&#187; Website Coding</title>
	<atom:link href="http://www.designchemical.com/blog/index.php/category/website-coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.designchemical.com/blog</link>
	<description>Your Business Catalyst</description>
	<lastBuildDate>Wed, 21 Jul 2010 08:33:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>jQuery Simple Horizontal Accordion</title>
		<link>http://www.designchemical.com/blog/index.php/jquery/jquery-simple-horizontal-accordion/</link>
		<comments>http://www.designchemical.com/blog/index.php/jquery/jquery-simple-horizontal-accordion/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 08:17:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Website Coding]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=874</guid>
		<description><![CDATA[<a href="http://www.designchemical.com/blog/index.php/jquery/jquery-simple-horizontal-accordion/"><img align="left" hspace="5" width="120" height="120" src="http://www.designchemical.com/blog/wp-content/uploads/2010/05/thumb_jquery_code.png" class="alignleft tfe wp-post-image" alt="" title="thumb_jquery_code" /></a><p>After our tutorial last month showing how to <a href="/blog/index.php/jquery/jquery-simple-vertical-accordion-menu/">create a vertical accordion menu using jQuery</a> we have had a couple of requests asking how to make a horizontal accordion.</p>
<p>So we have decided to provide the following post, which&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>After our tutorial last month showing how to <a href="/blog/index.php/jquery/jquery-simple-vertical-accordion-menu/">create a vertical accordion menu using jQuery</a> we have had a couple of requests asking how to make a horizontal accordion.</p>
<p>So we have decided to provide the following post, which shows very easily how to use the power of jQuery to create a rather nice horizontal accordion effect.</p>
<p><a href="/lab/jquery/demo/jquery_simple_horizontal_accordion.htm">Click here if you would prefer to skip straight to the demo</a></p>
<h3><strong>1. The HTML</strong></h3>
<p>First we create an unordered HTML list with id=&#8221;accordion&#8221; and include some content in each of the li tags &#8211; since the accordion is horizontal we have decided to use images to create the section labels:</p>
<pre class="brush: php;">
&lt;ul id=&quot;accordion&quot;&gt;
    &lt;li&gt;
      &lt;a href=&quot;#&quot;&gt;
        &lt;img src=&quot;images/section_1.png&quot; /&gt;
        &lt;strong&gt;Section 1 Header&lt;/strong&gt;&lt;br/&gt;
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. In iaculis volutpat quam, non suscipit arcu accumsan at. Aliquam pellentesque.
      &lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href=&quot;#&quot;&gt;
        &lt;img src=&quot;images/section_2.png&quot; /&gt;
        &lt;strong&gt;Section 2 Header&lt;/strong&gt;&lt;br/&gt;
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. In iaculis volutpat quam, non suscipit arcu accumsan at. Aliquam pellentesque.
      &lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href=&quot;#&quot;&gt;
        &lt;img src=&quot;images/section_3.png&quot; /&gt;
        &lt;strong&gt;Section 3 Header&lt;/strong&gt;&lt;br/&gt;
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. In iaculis volutpat quam, non suscipit arcu accumsan at. Aliquam pellentesque.
      &lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href=&quot;#&quot;&gt;
        &lt;img src=&quot;images/section_4.png&quot; /&gt;
        &lt;strong&gt;Section 4 Header&lt;/strong&gt;&lt;br/&gt;
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. In iaculis volutpat quam, non suscipit arcu accumsan at. Aliquam pellentesque.
      &lt;/a&gt;
    &lt;/li&gt;
&lt;/ul&gt;
</pre>
<h3><strong>2. Style The Accordion</strong></h3>
<p>Next we add a few CSS rules, which will help style the accordion and its content:</p>
<pre class="brush: plain;">
#accordion {
list-style: none;
margin: 0;
padding: 0;
height: 200px;
overflow: hidden;
background: #7d8d96;}

#accordion li {
float: left;
border-left:
1px solid #fff;}

#accordion li a {
display: block;
height: 170px;
width: 50px;
padding: 15px 0;
overflow: hidden;
color: #fff;
text-decoration: none;
font-size: 16px;
line-height: 1.5em;}

#accordion li a img {
border: none;
border-right: 1px solid #fff;
float: left;
margin: -15px 15px 0 0;}

#accordion li a.active {
width: 445px;}
</pre>
<p>The main items to take note of here are the widths of the anchor tags, which need to be the same as the min-width setting in our jQuery below and the width of the &#8220;active&#8221; tag, which should equal the max-width of the accordion section.</p>
<p>The &#8220;#accordion li a.active&#8221; is also required to ensure that the default section is open when the page loads.</p>
<p>The rest is mainly styling of the background, text and positioning of the section header images.</p>
<h3><strong>3. The jQuery Code</strong></h3>
<p>Finally the jQuery to create the horizontal accordion effect &#8211; in this example we have used the &#8220;hover&#8221; event to trigger the animation:</p>
<pre class="brush: jscript;">
$(document).ready(function(){

  activeItem = $(&quot;#accordion li a:first&quot;);
  $(activeItem).addClass('active');

  $(&quot;#accordion li a&quot;).hover(function(){
      $(activeItem).animate({width: &quot;50px&quot;}, {duration:300, queue:false});
      $(this).animate({width: &quot;445px&quot;}, {duration:300, queue:false});
      activeItem = this;
  });

});
</pre>
<p>You can change which is the default open section upon page load by changing the &#8220;activeItem&#8221; variable &#8211; in our example we have used &#8220;#accordion li a:first&#8221; to select the first list item.</p>
<p>Other options that can be changed include the min-width (in this case 50px) and the max-width, which we have set to 445px &#8211; the values in these lines must match the values given in the CSS rules above.</p>
<p>The duration setting controls the time in milliseconds for the accordion to animate from minimum to maximum width &#8211; again these can be set according to your preference.</p>
<p>The queue:false is required to stop the accordion capturing every hover event and continuing to animate after the mouse has left the hover area.</p>
<p><a href="/lab/jquery/demo/jquery_simple_horizontal_accordion.htm">View the jQuery horizontal accordion demo.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/jquery/jquery-simple-horizontal-accordion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery Image Swap Using Click</title>
		<link>http://www.designchemical.com/blog/index.php/jquery/jquery-image-swap-using-click/</link>
		<comments>http://www.designchemical.com/blog/index.php/jquery/jquery-image-swap-using-click/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 09:56:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Website Coding]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=834</guid>
		<description><![CDATA[<a href="http://www.designchemical.com/blog/index.php/jquery/jquery-image-swap-using-click/"><img align="left" hspace="5" width="120" height="120" src="http://www.designchemical.com/blog/wp-content/uploads/2010/05/thumb_jquery_code.png" class="alignleft tfe wp-post-image" alt="" title="thumb_jquery_code" /></a><p>In a previous post we showed a simple piece of jQuery code, which allows you to add the ability to <a href="/blog/index.php/jquery/quick-and-easy-jquery-image-swap/">swap images on hover</a> to your website. Since then we have had several requests asking how to add a&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>In a previous post we showed a simple piece of jQuery code, which allows you to add the ability to <a href="/blog/index.php/jquery/quick-and-easy-jquery-image-swap/">swap images on hover</a> to your website. Since then we have had several requests asking how to add a similar effect using &#8220;click&#8221; instead.</p>
<h3>The Image</h3>
<p>Use the same naming system for the 2 images as in our previous post &#8211; i.e. normal state called xxxxxx_off.jpg and the clicked state xxxxxx_on.jpg and add the class &#8220;img-swap&#8221; to the image tag in your HTML:</p>
<pre class="brush: plain;">
&lt;img src=&quot;xxxxxx_off.jpg&quot; class=&quot;img-swap&quot; /&gt;
</pre>
<h3>jQuery Code</h3>
<p>With just a few lines of jQuery you can now add the image swap function on click to any images in your web pages:</p>
<pre class="brush: jscript;">
$(function(){
  $(&quot;.img-swap&quot;).live('click', function() {
    if ($(this).attr(&quot;class&quot;) == &quot;img-swap&quot;) {
      this.src = this.src.replace(&quot;_off&quot;,&quot;_on&quot;);
    } else {
      this.src = this.src.replace(&quot;_on&quot;,&quot;_off&quot;);
    }
    $(this).toggleClass(&quot;on&quot;);
  });
});
</pre>
<p><a href="http://www.designchemical.com/lab/jquery/demo/jquery_image_swap_click.htm">See the demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/jquery/jquery-image-swap-using-click/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Simple Vertical Accordion Menu</title>
		<link>http://www.designchemical.com/blog/index.php/jquery/jquery-simple-vertical-accordion-menu/</link>
		<comments>http://www.designchemical.com/blog/index.php/jquery/jquery-simple-vertical-accordion-menu/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 02:40:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Website Coding]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=827</guid>
		<description><![CDATA[<a href="http://www.designchemical.com/blog/index.php/jquery/jquery-simple-vertical-accordion-menu/"><img align="left" hspace="5" width="120" height="120" src="http://www.designchemical.com/blog/wp-content/uploads/2010/05/thumb_jquery_code.png" class="alignleft tfe wp-post-image" alt="" title="thumb_jquery_code" /></a><p>Today&#8217;s jQuery tutorial is a perfect example of how easy it is to add a slick vertical accordion style menu to your website with just a few lines of jQuery code!</p>
<h3>The HTML</h3>
<p>First we create a nested unordered list,&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s jQuery tutorial is a perfect example of how easy it is to add a slick vertical accordion style menu to your website with just a few lines of jQuery code!</p>
<h3>The HTML</h3>
<p>First we create a nested unordered list, which will include all of our links. Give the first ul tag a unique id &#8211; we use #nav:</p>
<pre class="brush: plain;">
&lt;ul id=&quot;nav&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Item 1&lt;/a&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Sub-Item 1 a&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Sub-Item 1 b&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Sub-Item 1 c&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Item 2&lt;/a&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Sub-Item 2 a&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Sub-Item 2 b&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Item 3&lt;/a&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Sub-Item 3 a&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Sub-Item 3 b&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Sub-Item 3 c&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Sub-Item 3 d&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Item 4&lt;/a&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Sub-Item 4 a&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Sub-Item 4 b&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Sub-Item 4 c&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</pre>
<h3>Style The Menu With CSS</h3>
<p>For this tutorial we add a little styling to the menu and use CSS to hide the sub-menus using &#8220;display: none;&#8221;:</p>
<pre class="brush: plain;">
#nav {float: left; width: 280px;  border-top: 1px solid #999; border-right: 1px solid #999; border-left: 1px solid #999;}
#nav li a {display: block; padding: 10px 15px; background: #ccc; border-top: 1px solid #eee; border-bottom: 1px solid #999; text-decoration: none; color: #000;}
#nav li a:hover, #nav li a.active {background: #999; color: #fff;}
#nav li ul {display: none;}
#nav li ul li a {padding: 10px 25px; background: #ececec; border-bottom: 1px dotted #ccc;}
</pre>
<h3>The jQuery Code</h3>
<p>To create the accordion effect the code is extremely simple:</p>
<pre class="brush: jscript;">
$(document).ready(function () {
  $('#nav &gt; li &gt; a').click(function(){
    if ($(this).attr('class') != 'active'){
      $('#nav li ul').slideUp();
      $(this).next().slideToggle();
      $('#nav li a').removeClass('active');
      $(this).addClass('active');
    }
  });
});
</pre>
<p>First we use the child selector &#8220;>&#8221; to ensure that only the parent links activate the accordion menu &#8211; otherwise you would end up closing the menu each time a sub-link is clicked.
<p>We add a new class to the active item &#8211; this allows us to not only style the open accordion menu but also identify if a sub-menu is open when a link is clicked. The above jQuery code will only work on closed menu items.</p>
<p><a href="http://www.designchemical.com/lab/jquery/demo/jquery_simple_accordion_menu.htm">View the jQuery vertical accordion menu demo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/jquery/jquery-simple-vertical-accordion-menu/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Change Order of Multiple Select Lists Using jQuery</title>
		<link>http://www.designchemical.com/blog/index.php/jquery/change-order-multiple-select-lists-using-jquery/</link>
		<comments>http://www.designchemical.com/blog/index.php/jquery/change-order-multiple-select-lists-using-jquery/#comments</comments>
		<pubDate>Fri, 21 May 2010 09:36:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Website Coding]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=448</guid>
		<description><![CDATA[<a href="http://www.designchemical.com/blog/index.php/jquery/change-order-multiple-select-lists-using-jquery/"><img align="left" hspace="5" width="120" height="120" src="http://www.designchemical.com/blog/wp-content/uploads/2010/05/thumb_jquery_code.png" class="alignleft tfe wp-post-image" alt="" title="thumb_jquery_code" /></a><p>In my last post I went through the code required to <a href="http://www.designchemical.com/blog/index.php/jquery/create-add-remove-select-lists-using-jquery/">create an add/remove select list using jQuery</a>.</p>
<p>Today&#8217;s post is going to expand on the earlier tutorial and add up/down buttons, which will allow you to change the&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>In my last post I went through the code required to <a href="http://www.designchemical.com/blog/index.php/jquery/create-add-remove-select-lists-using-jquery/">create an add/remove select list using jQuery</a>.</p>
<p>Today&#8217;s post is going to expand on the earlier tutorial and add up/down buttons, which will allow you to change the order of the option items in the select list.</p>
<h3>The HTML Code</h3>
<p>The HTML code for the select lists remains the same as the earlier post, except with the addition of the &#8220;up&#8221; and &#8220;down&#8221; links:</p>
<pre class="brush: plain;">
&lt;form&gt;
  &lt;fieldset&gt;

    &lt;select name=&quot;selectfrom&quot; id=&quot;select-from&quot; multiple size=&quot;5&quot;&gt;
      &lt;option value=&quot;1&quot;&gt;Item 1&lt;/option&gt;
      &lt;option value=&quot;2&quot;&gt;Item 2&lt;/option&gt;
      &lt;option value=&quot;3&quot;&gt;Item 3&lt;/option&gt;
      &lt;option value=&quot;4&quot;&gt;Item 4&lt;/option&gt;
    &lt;/select&gt;

    &lt;a href=&quot;JavaScript:void(0);&quot; id=&quot;btn-add&quot;&gt;Add &amp;raquo;&lt;/a&gt;
    &lt;a href=&quot;JavaScript:void(0);&quot; id=&quot;btn-remove&quot;&gt;&amp;laquo; Remove&lt;/a&gt;

    &lt;select name=&quot;selectto&quot; id=&quot;select-to&quot; multiple size=&quot;5&quot;&gt;
      &lt;option value=&quot;5&quot;&gt;Item 5&lt;/option&gt;
      &lt;option value=&quot;6&quot;&gt;Item 6&lt;/option&gt;
      &lt;option value=&quot;7&quot;&gt;Item 7&lt;/option&gt;
    &lt;/select&gt;

    &lt;a href=&quot;JavaScript:void(0);&quot; id=&quot;btn-up&quot;&gt;Up&lt;/a&gt;
    &lt;a href=&quot;JavaScript:void(0);&quot; id=&quot;btn-down&quot;&gt;Down&lt;/a&gt;

  &lt;/fieldset&gt;
&lt;/form&gt;
</pre>
<h3>The jQuery Code</h3>
<p>Again, keeping the same code for the add/remove functions, we just need to add the additional jQuery to handle the up/down links:</p>
<pre class="brush: jscript;">
$(document).ready(function() {

    $('#btn-add').click(function(){
        $('#select-from option:selected').each( function() {
                $('#select-to').append(&quot;&lt;option value='&quot;+$(this).val()+&quot;'&gt;&quot;+$(this).text()+&quot;&lt;/option&gt;&quot;);
            $(this).remove();
        });
    });
    $('#btn-remove').click(function(){
        $('#select-to option:selected').each( function() {
            $('#select-from').append(&quot;&lt;option value='&quot;+$(this).val()+&quot;'&gt;&quot;+$(this).text()+&quot;&lt;/option&gt;&quot;);
            $(this).remove();
        });
    });

    $('#btn-up').bind('click', function() {
		$('#select-to option:selected').each( function() {
			var newPos = $('#select-to option').index(this) - 1;
			if (newPos &gt; -1) {
				$('#select-to option').eq(newPos).before(&quot;&lt;option value='&quot;+$(this).val()+&quot;' selected='selected'&gt;&quot;+$(this).text()+&quot;&lt;/option&gt;&quot;);
				$(this).remove();
			}
		});
	});
	$('#btn-down').bind('click', function() {
		var countOptions = $('#select-to option').size();
		$('#select-to option:selected').each( function() {
			var newPos = $('#select-to option').index(this) + 1;
			if (newPos &lt; countOptions) {
				$('#select-to option').eq(newPos).after(&quot;&lt;option value='&quot;+$(this).val()+&quot;' selected='selected'&gt;&quot;+$(this).text()+&quot;&lt;/option&gt;&quot;);
				$(this).remove();
			}
		});
	});
});
</pre>
<h4>1. The &#8220;Up&#8221; Link</h4>
<p>First we tackle the &#8220;up&#8221; link. Basically how we handle this is to retrieve the index value of each selected option, set the variable for the option items new position as &#8230; current index &#8211; 1, recreate the option HTML and insert it &#8220;before&#8221; the new index position. Finally &#8211; remove the old HTML from the list.</p>
<p>In order to make sure that we dont lose the option item off list list by trying to insert at an index position < 0 we do a quick check on the current position and only run the code if index > 0.</p>
<h4>2. The &#8220;Down&#8221; Link</h4>
<p>The down link is very similar except we set the new index postion to &#8220;current + 1&#8243; and insert the option HTML &#8220;after&#8221; this value.
<p>Once again we need to make sure that we dont lose the option item off the bottom of the list so we include an &#8220;if&#8221; statement, which checks the total number of items in the list and only runs the code if the new index position is less than the total items.</p>
<p>The above code also works for multiple selected items.</p>
<p>Check out the <a href="/lab/jquery/demo/jquery_change_order_select_list.htm">change order of select lists demo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/jquery/change-order-multiple-select-lists-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Add &amp; Remove Select Lists Using jQuery</title>
		<link>http://www.designchemical.com/blog/index.php/jquery/create-add-remove-select-lists-using-jquery/</link>
		<comments>http://www.designchemical.com/blog/index.php/jquery/create-add-remove-select-lists-using-jquery/#comments</comments>
		<pubDate>Wed, 19 May 2010 19:20:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Website Coding]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=437</guid>
		<description><![CDATA[<a href="http://www.designchemical.com/blog/index.php/jquery/create-add-remove-select-lists-using-jquery/"><img align="left" hspace="5" width="120" height="120" src="http://www.designchemical.com/blog/wp-content/uploads/2010/05/thumb_jquery_code.png" class="alignleft tfe wp-post-image" alt="" title="thumb_jquery_code" /></a><p>JQuery makes it very easy to select specific elements and their attributes in your web page HTML.</p>
<p>In the following tutorial I will show you how to use just a few lines of jQuery to create an add/remove select list&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>JQuery makes it very easy to select specific elements and their attributes in your web page HTML.</p>
<p>In the following tutorial I will show you how to use just a few lines of jQuery to create an add/remove select list for your website form.</p>
<h3>The Form HTML</h3>
<pre class="brush: plain;">
&lt;form&gt;
  &lt;fieldset&gt;

    &lt;select name=&quot;selectfrom&quot; id=&quot;select-from&quot; multiple size=&quot;5&quot;&gt;
      &lt;option value=&quot;1&quot;&gt;Item 1&lt;/option&gt;
      &lt;option value=&quot;2&quot;&gt;Item 2&lt;/option&gt;
      &lt;option value=&quot;3&quot;&gt;Item 3&lt;/option&gt;
      &lt;option value=&quot;4&quot;&gt;Item 4&lt;/option&gt;
    &lt;/select&gt;

    &lt;a href=&quot;JavaScript:void(0);&quot; id=&quot;btn-add&quot;&gt;Add &amp;raquo;&lt;/a&gt;
    &lt;a href=&quot;JavaScript:void(0);&quot; id=&quot;btn-remove&quot;&gt;&amp;laquo; Remove&lt;/a&gt;

    &lt;select name=&quot;selectto&quot; id=&quot;select-to&quot; multiple size=&quot;5&quot;&gt;
      &lt;option value=&quot;5&quot;&gt;Item 5&lt;/option&gt;
      &lt;option value=&quot;6&quot;&gt;Item 6&lt;/option&gt;
      &lt;option value=&quot;7&quot;&gt;Item 7&lt;/option&gt;
    &lt;/select&gt;

  &lt;/fieldset&gt;
&lt;/form&gt;
</pre>
<p>So here we have just 2 select lists with sample data &#8211; the top one listing the items &#8220;from&#8221;. There are also 2 anchor tags, which provide the &#8220;add&#8221; and &#8220;remove&#8221; links.</p>
<h3>The jQuery Code</h3>
<pre class="brush: jscript;">
$(document).ready(function() {

    $('#btn-add').click(function(){
        $('#select-from option:selected').each( function() {
                $('#select-to').append(&quot;&lt;option value='&quot;+$(this).val()+&quot;'&gt;&quot;+$(this).text()+&quot;&lt;/option&gt;&quot;);
            $(this).remove();
        });
    });
    $('#btn-remove').click(function(){
        $('#select-to option:selected').each( function() {
            $('#select-from').append(&quot;&lt;option value='&quot;+$(this).val()+&quot;'&gt;&quot;+$(this).text()+&quot;&lt;/option&gt;&quot;);
            $(this).remove();
        });
    });

});
</pre>
<p>Basically what we do here is that when either of the &#8220;add&#8221; or &#8220;remove&#8221; links are clicked jQuery will get the values for all of the relevant options that are selected, recreate each option item HTML, insert it into the opposite select list and finally remove these items from the original list.</p>
<p>Check out the <a href="/lab/jquery/demo/jquery_create_add_remove_select_list.htm">jquery add &#038; remove select list demo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/jquery/create-add-remove-select-lists-using-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple Tabs with AJAX and jQuery</title>
		<link>http://www.designchemical.com/blog/index.php/jquery/simple-tabs-with-ajax-and-jquery/</link>
		<comments>http://www.designchemical.com/blog/index.php/jquery/simple-tabs-with-ajax-and-jquery/#comments</comments>
		<pubDate>Sun, 02 May 2010 18:15:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Design Tips]]></category>
		<category><![CDATA[Website Coding]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=421</guid>
		<description><![CDATA[<a href="http://www.designchemical.com/blog/index.php/jquery/simple-tabs-with-ajax-and-jquery/"><img align="left" hspace="5" width="120" height="120" src="http://www.designchemical.com/blog/wp-content/uploads/2010/05/thumb_jquery_code.png" class="alignleft tfe wp-post-image" alt="" title="thumb_jquery_code" /></a><p>One of the great things about jQuery is its complete suite of built in AJAX functions, which allow you to add quick and easy features to your website.</p>
<p>The example below came from a recent project to create an internal&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>One of the great things about jQuery is its complete suite of built in AJAX functions, which allow you to add quick and easy features to your website.</p>
<p>The example below came from a recent project to create an internal web application for a client, which utilised tab navigation, jQuery and AJAX to load data into the page without the need to refresh the web page.</p>
<h3>1. The HTML Code</h3>
<pre class="brush: plain;">

&lt;ul id=&quot;nav&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;page_1.html&quot;&gt;Page 1&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;page_2.html&quot;&gt;Page 2&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;page_3.html&quot;&gt;Page 3&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div id=&quot;ajax-content&quot;&gt;This is default text, which will be replaced&lt;/div&gt;
</pre>
<p>You can fill the &#8220;ajax-content&#8221; div with default text, which will be replaced when one of the tabs are clicked.</p>
<h3>2. The jQuery Code</h3>
<pre class="brush: jscript;">

$(document).ready(function() {
    $(&quot;#nav li a&quot;).click(function() {

        $(&quot;#ajax-content&quot;).empty().append(&quot;&lt;div id='loading'&gt;&lt;img src='images/loading.gif' alt='Loading' /&gt;&lt;/div&gt;&quot;);
        $(&quot;#nav li a&quot;).removeClass('current');
        $(this).addClass('current');

        $.ajax({ url: this.href, success: function(html) {
            $(&quot;#ajax-content&quot;).empty().append(html);
            }
	});
	return false;
    });
});
</pre>
<p>The above jQuery code will automatically use the URL written into each anchor tag as the source for the AJAX data.</p>
<p>So what is the above code doing?</p>
<ol>
<li>When a tab is clicked we first empty the contents of the ajax-content div and then load a loading graphic, whilst the content is being retrieved.</li>
<li>The jQuery then removes the &#8220;current&#8221; class from the tabs and adds the class to the newly clicked anchor tag allowing you to style the tabs to show which one is now active.</li>
<li>Once the data from the URL has been retrieved the loading image is removed and the content loaded into the &#8220;ajax-content&#8221; div.</li>
<li>Finally, the &#8220;return false&#8221; command is used to prevent the default action of the tabs browsing to the content pages.</li>
</ol>
<h3>3. Loading A Default Page</h3>
<p>If you wanted to use one of the external pages as your default content you can simply edit the code as below:</p>
<pre class="brush: jscript;">

$(document).ready(function() {
    $(&quot;#nav li a&quot;).click(function() {

        $(&quot;#ajax-content&quot;).empty().append(&quot;&lt;div id='loading'&gt;&lt;img src='images/loading.gif' alt='Loading' /&gt;&lt;/div&gt;&quot;);
        $(&quot;#nav li a&quot;).removeClass('current');
        $(this).addClass('current');

        $.ajax({ url: this.href, success: function(html) {
            $(&quot;#ajax-content&quot;).empty().append(html);
            }
	});
	return false;
    });

    $(&quot;#ajax-content&quot;).empty().append(&quot;&lt;div id='loading'&gt;&lt;img src='images/loading.gif' alt='Loading' /&gt;&lt;/div&gt;&quot;);
	$.ajax({ url: 'page_1.html', success: function(html) {
            $(&quot;#ajax-content&quot;).empty().append(html);
	}
    });
});
</pre>
<p>Substitute the URL for your required page in the code.</p>
<p>A very simple yet effective way to create a basic jQuery and AJAX application for your website &#8211; <a href="/lab/jquery/demo/jquery_ajax_tabs_demo.htm">Check out the demo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/jquery/simple-tabs-with-ajax-and-jquery/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How To Add Blog Posts To A Wordpress Page</title>
		<link>http://www.designchemical.com/blog/index.php/wordpress-tips/how-to-add-blog-posts-to-a-wordpress-page/</link>
		<comments>http://www.designchemical.com/blog/index.php/wordpress-tips/how-to-add-blog-posts-to-a-wordpress-page/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 20:22:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Website Coding]]></category>
		<category><![CDATA[Wordpress Tips]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=389</guid>
		<description><![CDATA[<a href="http://www.designchemical.com/blog/index.php/wordpress-tips/how-to-add-blog-posts-to-a-wordpress-page/"><img align="left" hspace="5" width="120" height="120" src="http://www.designchemical.com/blog/wp-content/uploads/2010/05/thumb_wp_posts_page.png" class="alignleft tfe wp-post-image" alt="" title="thumb_wp_posts_page" /></a><p>By default pages in Wordpress websites will not display blog posts. However, there is a quick an easy way to edit the code of your theme page to handle this.</p>
<h3>1. Wordpress Theme Page Code</h3>
<p>First create a new page&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>By default pages in Wordpress websites will not display blog posts. However, there is a quick an easy way to edit the code of your theme page to handle this.</p>
<h3>1. Wordpress Theme Page Code</h3>
<p>First create a new page for your theme. Then add the following code to the web page in the area where you normally display the main content:</p>
<pre class="brush: plain;">
&lt;?php
global $more;
$more = 0;

  $post_per_page = 10; // -1 shows all posts
  $args=array('category_name' =&gt; 'Latest News', 'posts_per_page' =&gt; $post_per_page);
?&gt;

&lt;?php query_posts($args); ?&gt;
    &lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;

        &lt;div class=&quot;post&quot; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;
            &lt;h3&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
            &lt;?php the_content('read more ...'); ?&gt;
        &lt;/div&gt;

    &lt;?php endwhile; ?&gt;
&lt;?php endif; ?&gt;
</pre>
<p>The above code allows you to select posts from a specific categories and display the excerpts on the page. In this example we select our &#8220;Latest News&#8221; category &#8211; change the &#8216;category_name&#8217; => &#8216;Latest News&#8217; to suit your requirements.</p>
<p>You can also control the number of posts displayed by changing the &#8220;$post_per_page&#8221; parameter.</p>
<h3>2. How To Use In Your Page</h3>
<p>Very simply &#8211; upload your new template file to your themes folder, create a new page in your Wordpress admin and assign the new template file to this page.</p>
<p>There you have it &#8211; a custom page on your Wordpress website showing latest posts. To add more pages just repeat the process by creating a new theme page file and change category name parameter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/wordpress-tips/how-to-add-blog-posts-to-a-wordpress-page/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Check Passwords Using jQuery</title>
		<link>http://www.designchemical.com/blog/index.php/jquery/check-passwords-using-jquery/</link>
		<comments>http://www.designchemical.com/blog/index.php/jquery/check-passwords-using-jquery/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 18:00:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Design Tips]]></category>
		<category><![CDATA[Website Coding]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=387</guid>
		<description><![CDATA[<a href="http://www.designchemical.com/blog/index.php/jquery/check-passwords-using-jquery/"><img align="left" hspace="5" width="120" height="120" src="http://www.designchemical.com/blog/wp-content/uploads/2010/05/thumb_jquery_code.png" class="alignleft tfe wp-post-image" alt="" title="thumb_jquery_code" /></a><p>We have had several requests on how to use jQuery to check that passwords match in your website registration form when requesting visitors to re-enter their passwords.</p>
<p>This can easily be achieved by using similar code shown in our previous&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>We have had several requests on how to use jQuery to check that passwords match in your website registration form when requesting visitors to re-enter their passwords.</p>
<p>This can easily be achieved by using similar code shown in our previous posts on <a href="/blog/index.php/jquery/using-jquery-to-validate-search-box-input/">Using jQuery to Validate Search Box Input</a> and <a href="/blog/index.php/jquery/email-validation-using-jquery/">Email Validation Using jQuery</a>.</p>
<h3>1. The Password Input Fields</h3>
<pre class="brush: plain;">
&lt;form method=&quot;post&quot; name=&quot;form1&quot; id=&quot;form-password&quot; action=&quot;&quot;&gt;
  &lt;fieldset&gt;
    &lt;label&gt;Password:&lt;/label&gt;
    &lt;input type=&quot;password&quot; name=&quot;password&quot; id=&quot;password&quot; value=&quot;&quot; size=&quot;32&quot; /&gt;
    &lt;label&gt;Re-Enter Password:&lt;/label&gt;
    &lt;input type=&quot;password&quot; name=&quot;password-check&quot; id=&quot;password-check&quot; value=&quot;&quot; size=&quot;32&quot; /&gt;
    &lt;input type=&quot;submit&quot; value=&quot;Submit&quot; id=&quot;submit&quot;&gt;
  &lt;/fieldset&gt;
&lt;/form&gt;
</pre>
<h3>2. The jQuery Validation Code &#8211; Check That Both Passwords Match</h3>
<pre class="brush: jscript;">
jQuery(function(){
        $(&quot;#submit&quot;).click(function(){
        $(&quot;.error&quot;).hide();
        var hasError = false;
        var passwordVal = $(&quot;#password&quot;).val();
        var checkVal = $(&quot;#password-check&quot;).val();
        if (passwordVal == '') {
            $(&quot;#password&quot;).after('&lt;span class=&quot;error&quot;&gt;Please enter a password.&lt;/span&gt;');
            hasError = true;
        } else if (checkVal == '') {
            $(&quot;#password-check&quot;).after('&lt;span class=&quot;error&quot;&gt;Please re-enter your password.&lt;/span&gt;');
            hasError = true;
        } else if (passwordVal != checkVal ) {
            $(&quot;#password-check&quot;).after('&lt;span class=&quot;error&quot;&gt;Passwords do not match.&lt;/span&gt;');
            hasError = true;
        }
        if(hasError == true) {return false;}
    });
});
</pre>
<p>The above code will perform the following checks upon clicking the submit button:</p>
<ul>
<li>Check that a password has been entered and return an error message if the input field is empty.</li>
<li>Check that the &#8220;re-enter password&#8221; field contains text and return an error message if the input field is empty.</li>
<li>Finally &#8211; compare both password texts to check if they match</li>
</ul>
<p>If any of the validation checks return an error then the form submission on your website is stopped with the &#8220;return false&#8221; command.</p>
<p><a href="/lab/jquery/demo/check_passwords_using_jquery.htm">Check out the demo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/jquery/check-passwords-using-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using jQuery to Validate Search Box Input</title>
		<link>http://www.designchemical.com/blog/index.php/jquery/using-jquery-to-validate-search-box-input/</link>
		<comments>http://www.designchemical.com/blog/index.php/jquery/using-jquery-to-validate-search-box-input/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 20:18:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Website Coding]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=383</guid>
		<description><![CDATA[<a href="http://www.designchemical.com/blog/index.php/jquery/using-jquery-to-validate-search-box-input/"><img align="left" hspace="5" width="120" height="120" src="http://www.designchemical.com/blog/wp-content/uploads/2010/05/thumb_jquery_code.png" class="alignleft tfe wp-post-image" alt="" title="thumb_jquery_code" /></a><p>Today&#8217;s tip is just another simple example of how you can use the versatile jQuery library to validate form input text in your website.</p>
<p>In a recent project a client required validation on a search form input that would only&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s tip is just another simple example of how you can use the versatile jQuery library to validate form input text in your website.</p>
<p>In a recent project a client required validation on a search form input that would only allow numbers, letters and a &#8220;-&#8221;.</p>
<h3>The Search Form</h3>
<pre class="brush: plain;">
&lt;form method=&quot;post&quot; name=&quot;form1&quot; id=&quot;search&quot; action=&quot;&quot;&gt;
  &lt;fieldset&gt;
    &lt;label&gt;Search:&lt;/label&gt;
    &lt;input type=&quot;text&quot; name=&quot;search-text&quot; id=&quot;search-text&quot; value=&quot;&quot; size=&quot;32&quot; /&gt;
    &lt;input type=&quot;submit&quot; value=&quot;Submit&quot; id=&quot;btn-search&quot;&gt;
  &lt;/fieldset&gt;
&lt;/form&gt;
</pre>
<h3>The jQuery Validation Code</h3>
<pre class="brush: jscript;">
jQuery(function(){
        $(&quot;#btn-search&quot;).click(function(){
        $(&quot;.error&quot;).hide();
        var hasError = false;
        var searchReg = /^[a-zA-Z0-9-]+$/;
        var searchVal = $(&quot;#search-text&quot;).val();
        if(searchVal == '') {
            $(&quot;#search-text&quot;).after('&lt;span class=&quot;error&quot;&gt;Please enter a search term.&lt;/span&gt;');
            hasError = true;
        } else if(!searchReg.test(searchVal)) {
            $(&quot;#search-text&quot;).after('&lt;span class=&quot;error&quot;&gt;Enter valid text.&lt;/span&gt;');
            hasError = true;
        }
        if(hasError == true) {return false;}
    });
});
</pre>
<p>The above code will first check that text has been entered and return an error message if the search box is empty. Then check, using a simple regular expression, that the entered text only contains alphanumeric characters or a &#8220;-&#8221;. If either of these validation checks return and error message then the form submission is stopped with the &#8220;return false&#8221; command.</p>
<p><a href="/lab/jquery/demo/jquery_search_validation.htm">Check out the demo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/jquery/using-jquery-to-validate-search-box-input/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using jQuery to Hide Multiple Email Addresses From Spam Harvesters</title>
		<link>http://www.designchemical.com/blog/index.php/jquery/using-jquery-to-hide-multiple-email-addresses-from-spam-harvesters/</link>
		<comments>http://www.designchemical.com/blog/index.php/jquery/using-jquery-to-hide-multiple-email-addresses-from-spam-harvesters/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 19:38:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Website Coding]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=377</guid>
		<description><![CDATA[<a href="http://www.designchemical.com/blog/index.php/jquery/using-jquery-to-hide-multiple-email-addresses-from-spam-harvesters/"><img align="left" hspace="5" width="120" height="84" src="http://www.designchemical.com/blog/wp-content/uploads/2010/05/email_symbol.png" class="alignleft tfe wp-post-image" alt="" title="email_symbol" /></a><p>A few months ago we wrote about <a href="http://www.designchemical.com/blog/index.php/web-design-tips/hiding-your-email-addresses-from-spam-harvesters-part-ii/">using jQuery and AJAX to hide your email address from spam harvesters</a>. Although very effective it can get a little confusing if managing multiple email addresses throughout your website.</p>
<p>A simple solution&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>A few months ago we wrote about <a href="http://www.designchemical.com/blog/index.php/web-design-tips/hiding-your-email-addresses-from-spam-harvesters-part-ii/">using jQuery and AJAX to hide your email address from spam harvesters</a>. Although very effective it can get a little confusing if managing multiple email addresses throughout your website.</p>
<p>A simple solution can be set up, which allows you to use just a single file containing all of your website&#8217;s email addresses and just a few lines of jQuery.</p>
<h3><strong>1. Create Your Email List</strong></h3>
<p>In a HTML document create a list of your email addresses by placing each one inside a span tag and assigning an ID &#8211; see example below:</p>
<pre class="brush: plain;">
&lt;span id=&quot;email-1&quot;&gt;somebody@xxxxxxxxxx.com&lt;/span&gt;
&lt;span id=&quot;email-2&quot;&gt;another@xxxyyyyxxxxx.com&lt;/span&gt;
</pre>
<h3><strong>2. Add The jQuery Code</strong></h3>
<p>Now in the head of your web page add the following jQuery code:</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
	$(&quot;.email&quot;).each(function() {
		var var_email = $(this).html();
		$(this).load(&quot;email_list.html #&quot;+var_email).append(var_email);
	});
});
&lt;/script&gt;
</pre>
<p>In our example we have called the email file &#8211; email_list.html &#8211; you will need to change the above code to match your file name.</p>
<h3><strong>Using the Code in Your Web Page</strong></h3>
<p>To use this code all you need to do is wherever you would like an email address to appear is to include a span tag with the class &#8220;email&#8221; and inside the span tag write the ID of the email address you would like to insert. From our 2 example emails above we would therefore use the following:</p>
<pre class="brush: plain;">
&lt;span class=&quot;email&quot;&gt;email-1&lt;/span&gt;
&lt;span class=&quot;email&quot;&gt;email-2&lt;/span&gt;
</pre>
<p>The following source code:</p>
<pre class="brush: plain;">
&lt;p&gt;Suspendisse quis blandit justo &lt;span class=&quot;email&quot;&gt;email-1&lt;/span&gt;. In laoreet pharetra condimentum. Donec at venenatis quam &lt;span class=&quot;email&quot;&gt;email-2&lt;/span&gt;.&lt;/p&gt;
</pre>
<p>Which is how it would appear to spam harvesters, would then appear on your web page to your visitors as:</p>
<p>Suspendisse quis blandit justo somebody@xxxxxxxxxx.com. In laoreet pharetra condimentum. Donec at venenatis quam another@xxxyyyyxxxxx.com.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/jquery/using-jquery-to-hide-multiple-email-addresses-from-spam-harvesters/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Web Design &#8211; Core Files</title>
		<link>http://www.designchemical.com/blog/index.php/web-design/web-design-core-files/</link>
		<comments>http://www.designchemical.com/blog/index.php/web-design/web-design-core-files/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 18:47:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Design Tips]]></category>
		<category><![CDATA[Website Coding]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=352</guid>
		<description><![CDATA[<a href="http://www.designchemical.com/blog/index.php/web-design/web-design-core-files/"><img align="left" hspace="5" width="120" height="120" src="http://www.designchemical.com/blog/wp-content/uploads/2010/05/http_header.jpg" class="alignleft tfe wp-post-image" alt="" title="http_header" /></a><p>Since most websites start with the same set of core file requirements and most layouts have at least the same starting HTML and CSS structure you can speed up your initial web design by having a core set of files&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Since most websites start with the same set of core file requirements and most layouts have at least the same starting HTML and CSS structure you can speed up your initial web design by having a core set of files ready to use.</p>
<p>For our core files we usually have the main directory structure set up:</p>
<ul>
<li>CSS folder</li>
<li>Images Folders</li>
<li>Javscript folder for jQuery plugins</li>
<li>index.html file</li>
</ul>
<p>The index.html file already contains the link to download the latest jQuery library and of course the link to the basic CSS file. The page structure has the div tags for the header, main content and footer and associated CSS rules set up in the style.css file ready to create the main web design layout.</p>
<p>The CSS structure includes:</p>
<ul>
<li>CSS reset &#8211; to remove all default presentation from HTML tags</li>
<li>Coding to create a &#8220;sticky footer&#8221; on your web page</li>
<li>CSS classes to style the website main navigation &amp; footer navigation</li>
<li>Basic form presentation</li>
<li>CSS rules to to create buttons</li>
</ul>
<p>Although you need to develop your own core files that work best for your style of web design, you can however<br />
<a href="http://www.designchemical.com/lab/download/core.zip">download a copy of our core files</a> and are free to use these as a starting point or adapt them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/web-design/web-design-core-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Email Validation Using jQuery</title>
		<link>http://www.designchemical.com/blog/index.php/jquery/email-validation-using-jquery/</link>
		<comments>http://www.designchemical.com/blog/index.php/jquery/email-validation-using-jquery/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 14:10:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Website Coding]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=326</guid>
		<description><![CDATA[<a href="http://www.designchemical.com/blog/index.php/jquery/email-validation-using-jquery/"><img align="left" hspace="5" width="120" height="120" src="http://www.designchemical.com/blog/wp-content/uploads/2010/05/thumb_jquery_code.png" class="alignleft tfe wp-post-image" alt="" title="thumb_jquery_code" /></a><p>A client recently wanted to include validation on their website registration form that would not only check that the input text was a genuine email address but also to disallow registration of any &#8220;free&#8221; email addresses.</p>
<p>Using jQuery we can&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>A client recently wanted to include validation on their website registration form that would not only check that the input text was a genuine email address but also to disallow registration of any &#8220;free&#8221; email addresses.</p>
<p>Using jQuery we can easily add this to the website by creating a regular expression, which checks for email addresses such as yahoo, gmail, hotmail, etc prior to submitting the form to the server. The regular expression can be adapted to reject any domain specified.</p>
<p>First add the form to your website using standard HTML code:</p>
<pre class="brush: plain;">
&lt;form method=&quot;post&quot; name=&quot;form1&quot; action=&quot;&quot;&gt;
  &lt;fieldset&gt;
   &lt;label&gt;Email Address:&lt;/labe&gt;
   &lt;input type=&quot;text&quot; name=&quot;UserEmail&quot; id=&quot;UserEmail&quot; value=&quot;&quot; size=&quot;32&quot; /&gt;
   &lt;input type=&quot;submit&quot; value=&quot;Submit&quot; id=&quot;btn-submit&quot; /&gt;
  &lt;/fieldset&gt;
&lt;/form&gt;
</pre>
<h3>Step 1 &#8211; Initiate the jQuery Validation</h3>
<p><a href="http://www.designchemical.com/blog/index.php/jquery/adding-jquery-to-your-website/">After adding jQuery to your website</a> we set up the code that will perform the validation when the submit button is clicked &#8211; first clearing any existing error messages from previous attempts:</p>
<pre class="brush: jscript;">
$(document).ready(function() { 

    $('#btn-submit').click(function() {  

        $(&quot;.error&quot;).hide();
        var hasError = false;

    });
});
</pre>
<h3>Step 2 &#8211; Check that the Input Field is Not Empty</h3>
<p>For the first step of the validation we want to add the jQuery code that will check if there is any text in the input field and if not return the appropriate error message and stop the form being submitted:</p>
<pre class="brush: jscript;">
$(document).ready(function() { 

    $('#btn-submit').click(function() {  

        $(&quot;.error&quot;).hide();
        var hasError = false;

        var emailaddressVal = $(&quot;#UserEmail&quot;).val();
        if(emailaddressVal == '') {
            $(&quot;#UserEmail&quot;).after('&lt;span class=&quot;error&quot;&gt;Please enter your email address.&lt;/span&gt;');
            hasError = true;
        }

        if(hasError == true) { return false; }

    });
});
</pre>
<h3>Step 3 &#8211; Check that the Entered Text is a Valid Email Address</h3>
<p>Our first regular expression will check to make sure that the entered text is a valid email address &#8211; i.e. contains at least one &#8220;.&#8221;, an &#8220;@&#8221; symbol and an appropriate top-level domain suffix (e.g. .com, .net, etc):</p>
<pre class="brush: jscript;">
$(document).ready(function() { 

    $('#btn-submit').click(function() {  

        $(&quot;.error&quot;).hide();
        var hasError = false;
        var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;

        var emailaddressVal = $(&quot;#UserEmail&quot;).val();
        if(emailaddressVal == '') {
            $(&quot;#UserEmail&quot;).after('&lt;span class=&quot;error&quot;&gt;Please enter your email address.&lt;/span&gt;');
            hasError = true;
        }

        else if(!emailReg.test(emailaddressVal)) {
            $(&quot;#UserEmail&quot;).after('&lt;span class=&quot;error&quot;&gt;Enter a valid email address.&lt;/span&gt;');
            hasError = true;
        }

        if(hasError == true) { return false; }

    });
});
</pre>
<h3>Step 4 &#8211; Block or Prevent Free Email Addresses &#8211; e.g. yahoo.com, gmail.com and hotmail.com</h3>
<p>The 2nd regular expression will now check the entered text against our pre-defined domain names &#8211; in this case yahoo.com, gmail.com and hotmail.com. Once again an error message is displayed and the form submission stopped if the email address matches one of the domains:</p>
<pre class="brush: jscript;">
$(document).ready(function() { 

  $('#btn-submit').click(function() {  

    $(&quot;.error&quot;).hide();
    var hasError = false;
    var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
    var emailblockReg =
     /^([\w-\.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)([\w-]+\.)+[\w-]{2,4})?$/;

    var emailaddressVal = $(&quot;#UserEmail&quot;).val();
    if(emailaddressVal == '') {
      $(&quot;#UserEmail&quot;).after('&lt;span class=&quot;error&quot;&gt;Please enter your email address.&lt;/span&gt;');
      hasError = true;
    }

    else if(!emailReg.test(emailaddressVal)) {
      $(&quot;#UserEmail&quot;).after('&lt;span class=&quot;error&quot;&gt;Enter a valid email address.&lt;/span&gt;');
      hasError = true;
    }

    else if(!emailblockReg.test(emailaddressVal)) {
      $(&quot;#UserEmail&quot;).after('&lt;span class=&quot;error&quot;&gt;No yahoo, gmail or hotmail emails.&lt;/span&gt;');
      hasError = true
    } 

    if(hasError == true) { return false; }

    });
});
</pre>
<p>The above example can easily be configured to reject (or even accept) any specified email address. To see it in action &#8211; <a href="/lab/jquery/demo/jquery_email_validation.htm" title="jQuery Demo - Email Validation Using jQuery">Check out our online demo of Email Validation Using jQuery</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/jquery/email-validation-using-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create a Reverse-Order Ordered List Using jQuery</title>
		<link>http://www.designchemical.com/blog/index.php/web-design-tips/create-a-reverse-order-ordered-list-using-jquery/</link>
		<comments>http://www.designchemical.com/blog/index.php/web-design-tips/create-a-reverse-order-ordered-list-using-jquery/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 12:59:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Design Tips]]></category>
		<category><![CDATA[Website Coding]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=304</guid>
		<description><![CDATA[<a href="http://www.designchemical.com/blog/index.php/web-design-tips/create-a-reverse-order-ordered-list-using-jquery/"><img align="left" hspace="5" width="120" height="120" src="http://www.designchemical.com/blog/wp-content/uploads/2010/05/thumb_jquery_code.png" class="alignleft tfe wp-post-image" alt="" title="thumb_jquery_code" /></a><p>Earlier today I came across a small website coding &#8220;problem&#8221;, which required me to create a &#8220;top-ten&#8221; list of items in reverse order for a client.</p>
<p>Usually ordered lists are very simple to in XHTML create using the following code:&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Earlier today I came across a small website coding &#8220;problem&#8221;, which required me to create a &#8220;top-ten&#8221; list of items in reverse order for a client.</p>
<p>Usually ordered lists are very simple to in XHTML create using the following code:</p>
<pre class="brush: plain;">
&lt;ol&gt;
  &lt;li&gt;List item 1&lt;/li&gt;
  &lt;li&gt;List item 2&lt;/li&gt;
  &lt;li&gt;List item 3&lt;/li&gt;
  &lt;li&gt;List item 4&lt;/li&gt;
  &lt;li&gt;List item 5&lt;/li&gt;
&lt;/ol&gt;
</pre>
<p>Which will produce the following ordered list:</p>
<ol style="margin-left: 30px">
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
<li>List item 4</li>
<li>List item 5</li>
</ol>
<p>Unfortunately HTML won&#8217;t automatically handle reverse numbering. Adding the numbers manually into a standard unordered list looked messy and I wanted a solution that would automatically renumber the list in case anyone else came along and added more items &#8230; jQuery to the rescue.</p>
<p>Using some of the usual <a href="http://www.designchemical.com/blog/index.php/jquery/adding-jquery-to-your-website/" rel="external">jQuery magic</a> we can add the following code to the head of the document:</p>
<pre class="brush: jscript;">
$(document).ready(function() {   

   var countli = $('ol &gt; li').size();
   $(&quot;ol &gt; li&quot;).each(function(i) {
         var attrvalue = countli - i;
         $(this).attr(&quot;value&quot;,attrvalue);
   });
});
</pre>
<p>This will automatically reverse order all of the items in the ordered lists on the web page by adding the &#8220;value&#8221; attribute to each list item.</p>
<p><a href="/lab/jquery/demo/jquery_reverse_unordered_list.htm" title="Create a Reverse Order Ordered List Using jQuery" class="external">See demo for creating a reverse order ordered list using jQuery</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/web-design-tips/create-a-reverse-order-ordered-list-using-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick and Easy jQuery Image Swap</title>
		<link>http://www.designchemical.com/blog/index.php/jquery/quick-and-easy-jquery-image-swap/</link>
		<comments>http://www.designchemical.com/blog/index.php/jquery/quick-and-easy-jquery-image-swap/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 16:18:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Design Tips]]></category>
		<category><![CDATA[Website Coding]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=292</guid>
		<description><![CDATA[<a href="http://www.designchemical.com/blog/index.php/jquery/quick-and-easy-jquery-image-swap/"><img align="left" hspace="5" width="120" src="/lab/media/images/img_swap_off.png" class="alignleft wp-post-image tfe" alt="" title="" /></a><p>Here is a very quick and easy way to implement image swap on hover on your website using jQuery.</p>
<p>With the <a href="http://www.designchemical.com/blog/index.php/jquery/adding-jquery-to-your-website/">jQuery javascript library already added to your website</a> add the following javascript code between the head tags in&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Here is a very quick and easy way to implement image swap on hover on your website using jQuery.</p>
<p>With the <a href="http://www.designchemical.com/blog/index.php/jquery/adding-jquery-to-your-website/">jQuery javascript library already added to your website</a> add the following javascript code between the head tags in your web page:</p>
<pre class="brush: jscript;">
jQuery(function(){
     $(&quot;.img-swap&quot;).hover(
          function(){this.src = this.src.replace(&quot;_off&quot;,&quot;_on&quot;);},
          function(){this.src = this.src.replace(&quot;_on&quot;,&quot;_off&quot;);
     });
});
</pre>
<p>Then simply create your 2 images &#8211; normal state called xxxxxx_off.jpg and the hover state xxxxxx_on.jpg, add the css class &#8220;img-swap&#8221; to the image tag in your html and jQuery will do the rest &#8230; see demo below:</p>
<p><img src="/lab/media/images/img_swap_off.png" alt="" class="img-swap" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/jquery/quick-and-easy-jquery-image-swap/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hiding Your Email Addresses From Spam Harvesters &#8211; Part II</title>
		<link>http://www.designchemical.com/blog/index.php/web-design-tips/hiding-your-email-addresses-from-spam-harvesters-part-ii/</link>
		<comments>http://www.designchemical.com/blog/index.php/web-design-tips/hiding-your-email-addresses-from-spam-harvesters-part-ii/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 16:56:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Design Tips]]></category>
		<category><![CDATA[Website Coding]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=171</guid>
		<description><![CDATA[<p>Last week, in part I, we looked at <a href="http://www.designchemical.com/blog/index.php/web-design-tips/hiding-your-email-addresses-from-spam-harvesters/">hiding your email addresses from spam harvesters</a> using simple techniques such as rewriting your email address for humans only and replacing your email with an inline image.</p>
<p>Today we have 2&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Last week, in part I, we looked at <a href="http://www.designchemical.com/blog/index.php/web-design-tips/hiding-your-email-addresses-from-spam-harvesters/">hiding your email addresses from spam harvesters</a> using simple techniques such as rewriting your email address for humans only and replacing your email with an inline image.</p>
<p>Today we have 2 more techniques, which utilise the jQuery javascript library. If you are not sure how to include the library code into your web page then refer to our post &#8211; <a href="http://www.designchemical.com/blog/index.php/jquery/adding-jquery-to-your-website/">Adding jQuery To Your Website</a>. The following examples assume that your web page already includes the jQuery library.</p>
<h3><strong>3. Using The jQuery NoSpam Plugin</strong></h3>
<p>This is an excellent plugin written by Mike Branski, which renders the email address on the visitors browser using source code, which is scrambled (or obfuscated). To a spambot the source code only contains unreadable text.</p>
<p>An example of this method can be seen on our own <a href="/contacts.asp">contacts page</a> &#8211; see email underneath our contact details. In the actual source code this email address appears as follows:</p>
<pre class="brush: plain;">
moc/lacimehcngised//ofni
</pre>
<p>To use this method first download the plugin from the <a href="http://www.leftrightdesigns.com/library/jquery/nospam/">jQuery nospam plugin site</a>.</p>
<p>Now include the file inbetween your head tags, below the jQuery library link. Example &#8211; if you download the jquery.nospam.js file to your &#8220;js/&#8221; folder, then your code should look like this:</p>
<pre class="brush: plain;">
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.nospam.js&quot;&gt;&lt;/script&gt;
</pre>
<p>Next you need to initiate the code when the page loads so that the browser rewrites the email address in a readable format. To do this add the following code underneath the jquery.nospam.js link:</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
    $('.email').nospam({
        replaceText: true,
        filterLevel: 'normal'
    });
});
&lt;/script&gt;
</pre>
<p>The above code basically tells the browser to search through the html code when the page has loaded and rewrite any text that is held within tags with the CSS class &#8211; &#8220;email&#8221;.</p>
<p>To create your scrambled email address:</p>
<ol>
<li>write the address backwards</li>
<li>Replacing the &#8220;@&#8221; symbol with &#8220;//&#8221;</li>
<li>Replace all &#8220;.&#8221; with &#8220;/&#8221;</li>
</ol>
<p>Example:</p>
<p>For email address &#8211; email@mydomain.com &#8211; you would use the following code:</p>
<pre class="brush: plain;">
&lt;span class=&quot;email&quot;&gt;moc/niamodym//liame&lt;/span&gt;
</pre>
<p>To see a sample in action view the source code on our <a href="/contacts.asp">contacts page</a>.</p>
<h3><strong>4. Using jQuery and AJAX</strong></h3>
<p>All of the previous 3 methods are unable to handle the addition of a &#8220;mailto:&#8221; link, which will allow your visitor to open up a blank email containing your email address. A feature, which many people find very useful.</p>
<p>One way of maintaining the link is to use AJAX and jQuery. Using this method we can get the browser to call in the email address code from an external file, after the page has loaded. In most cases spambots would therefore not see the email address in the source code.</p>
<p><a href="http://www.designchemical.com/lab/jquery/demo/ajax_email.htm" target="_blank">View a demo of hiding your email address and mailto link using jQuery and AJAX</a></p>
<p>If you view the source code of the above page in your browser you will see that the email address does not appear and only shows on the browser screen.</p>
<p><a href="http://www.designchemical.com/lab/jquery/demo/ajax_email.zip" target="_blank">Download the source code for this example</a></p>
<p>To use this method add the following code after the jQuery javascript library, between the head tags:</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function(){

	var content = $(&quot;.email&quot;);
	content.load(&quot;email_address.htm&quot;);

});
&lt;/script&gt;
</pre>
<p>Finally in the body of the html page add the following code where you would like your email link to appear:</p>
<pre class="brush: plain;">
&lt;span class=&quot;email&quot;&gt;&lt;/span&gt;
</pre>
<p>A very simple, yet effective solution for hiding your email address link from annoying spammers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/web-design-tips/hiding-your-email-addresses-from-spam-harvesters-part-ii/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hiding Your Email Addresses From Spam Harvesters &#8211; Part I</title>
		<link>http://www.designchemical.com/blog/index.php/web-design-tips/hiding-your-email-addresses-from-spam-harvesters/</link>
		<comments>http://www.designchemical.com/blog/index.php/web-design-tips/hiding-your-email-addresses-from-spam-harvesters/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 06:40:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Design Tips]]></category>
		<category><![CDATA[Website Coding]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=113</guid>
		<description><![CDATA[<a href="http://www.designchemical.com/blog/index.php/web-design-tips/hiding-your-email-addresses-from-spam-harvesters/"><img align="left" hspace="5" width="120" src="/blog/wp-content/uploads/2009/12/email_sample1.png" class="alignleft wp-post-image tfe" alt="email sample image" title="" /></a><p>One of the biggest problems with putting your personal and/or business contact details onto your website is being inundated with spam just a few weeks after launching your site. This is due to automated programs trawling the internet and searching&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>One of the biggest problems with putting your personal and/or business contact details onto your website is being inundated with spam just a few weeks after launching your site. This is due to automated programs trawling the internet and searching the source code of unsuspecting website owners for email addresses.</p>
<p>There are many methods that you can use to try and hide your details from the spammers. Some require just simple changes to your text, whilst others, although a little more advanced, can be equally simple to implement.</p>
<p>The following are a few ideas that you can use to disguise your email address online. These are by no means the only ways but we have found them useful in the past in web design projects. The best method for you does of course depend on your own website requirements &#8230;</p>
<h3><strong>1. Rewriting Your Email Address</strong></h3>
<p>The most simple is probably just to rewrite your email address so that humans can understand it and spam harvesters tend to skip over it. Example:</p>
<p>email@mydomain.com could be rewritten as &#8230; email [AT] mydomain dot com.</p>
<p>Unfortunately this method obviously relies on the visitor to your website understanding what you mean and this is not necessarily going to fool all spam harvesters these days.</p>
<h3><strong>2. Replace Your Email Address with an Image</strong></h3>
<p>If you prefer to have your web page show your actual email address then one simple method is to replace the email text in your source code with an image as shown below:</p>
<p><img src="/blog/wp-content/uploads/2009/12/email_sample1.png" alt="email sample image" /></p>
<p>Hiding text in an image is a good way to stop spam harvesters picking out your email address &#8230; not impossible of course but far more tricky!</p>
<p>Whilst the above two methods work and offer lower risk ways of displaying your email address, one big problem is that you cannot use these to add the &#8220;mailto:&#8221; link. The mailto: link allows your visitor to automatically open their email software with a new blank email already populated with your email address as demonstrated if you click on the link below:</p>
<p><a href="mailto:someemail@somedomainexample.com">someemail@somedomainexample.com</a></p>
<p>Next week I will cover two more ways of beating the spammers, including one, which allows you to add a &#8220;mailto:&#8221; link with virtually no risk.</p>
<p><a href="http://www.designchemical.com/blog/index.php/2009/12/hiding-your-email-addresses-from-spam-harvesters-part-ii/">Hiding Your Email Addresses From Spam Harvesters &#8211; Part II</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/web-design-tips/hiding-your-email-addresses-from-spam-harvesters/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Benefits of Website HTML &amp; CSS Validation</title>
		<link>http://www.designchemical.com/blog/index.php/website-coding/benefits-of-website-html-css-validation/</link>
		<comments>http://www.designchemical.com/blog/index.php/website-coding/benefits-of-website-html-css-validation/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 16:31:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Validation]]></category>
		<category><![CDATA[Website Coding]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=56</guid>
		<description><![CDATA[<p>Many people ask the question &#8230; why validate?</p>
<p>Although most modern browsers will still display code with errors, validation ensures that your web pages meet current HTML and CSS standards. From a web designers point of view validation is a&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Many people ask the question &#8230; why validate?</p>
<p>Although most modern browsers will still display code with errors, validation ensures that your web pages meet current HTML and CSS standards. From a web designers point of view validation is a quick and easy way to check for errors that may be causing issues with the way your website renders on the screen.</p>
<p>There are however several areas where website validation is important for your site:</p>
<h3><strong>Website accessibility</strong></h3>
<p>An increasingly important aspect of web design is to develop and create websites where all of the information can be accessed by all visitors &#8230; afterall why build a website for your business if a significant portion of internet users cannot access the content?</p>
<p>The validation process helps identify potential areas where issues with accessibility may occur and removes possible &#8220;barriers&#8221; to visitors who may be vision impaired, motor impaired or cognitive impaired.</p>
<p>For many countries this is now becoming a legal requirement and it is important for both clients and web designers to ensure that your websites do not discriminate.</p>
<h3><strong>Search Engine Optimization</strong></h3>
<p>Search engine spiders use the structure of your web page to identify different components of your content to help with indexing. Whilst errors in code may not stop spiders in their tracks, code that is not correctly formed, e.g. <h> tags that are not closed or even tags that do not technically exist, may result in the search engines missing out on important keywords or phrases that identify your content.</p>
<p>At the end of the day your goal is to drive traffic to your website through organic search results. It would be unfortunate if all of your hard work developing valuable content is negated by simple errors in the HTML code.</p>
<p>Check out our <a href="http://www.designchemical.com/blog/index.php/search-engine-optimization/seo-alchemy-the-importance-of-good-code/">Search engine optimization and the importance of good code</a> blog post for more information.</p>
<h3><strong>Faster Web Page Loading Times</strong></h3>
<p>Validated code will help ensure that your browser renders the page as quickly as possible on the screen. In a world where the patience of internet users is constantly decreasing every second helps in guaranteeing that your visitors stay on your website.</p>
<h3><strong>Browser Compatibility</strong></h3>
<p>Website coding standards take into account future expected developments so although most modern browsers can handle errors in code, validation will help guarantee that as browsers develop your website will be &#8220;forwards compatible&#8221; and continue to function and render on the screen as originally intended.</p>
<p>Website validation helps reduce the possibility of having to hire a web designer for potentially costly rewrites of your web page in the not too distant future.</p>
<h3><strong>Updating Website Code</strong></h3>
<p>For web designers, updating other peoples code can be a frustrating a time consuming experience, spending several hours just to correct unecessary errors that should have not occurred in the first place. Creating semantically meaningful, valid HTML and CSS from day one will help your clients update their website in the future and ultimately minimize costs.</p>
<h3><strong>Be Professional With Your Web Design</strong></h3>
<p>From a web designers point of view, lets not forget one important aspect &#8230; creating valid, standards compliant XHTML and CSS is a sign of being professional. Whilst a website may look shiny on the surface, what&#8217;s below is equally important.</p>
<p>It is true however that validation does not guarantee that your pages will work in all browsers, neither does it mean that the XHTML and CSS used in the web page layout is appropriate but it is certainly a start to ensuring that your code is optimized and standards compliant. As a client you should expect your code to always validate.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/website-coding/benefits-of-website-html-css-validation/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Website HTML and CSS Validation</title>
		<link>http://www.designchemical.com/blog/index.php/validation/website-html-and-css-validation/</link>
		<comments>http://www.designchemical.com/blog/index.php/validation/website-html-and-css-validation/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 16:37:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Validation]]></category>
		<category><![CDATA[Website Coding]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=32</guid>
		<description><![CDATA[<p>I was amazed to recently read on one local forum someone advising that a web design company with a website that has less than 100 errors could be considered as &#8220;decent&#8221; &#8230; crazy &#8230; there is absolutely no reason at&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>I was amazed to recently read on one local forum someone advising that a web design company with a website that has less than 100 errors could be considered as &#8220;decent&#8221; &#8230; crazy &#8230; there is absolutely no reason at all for any errors or warnings in website code.</p>
<p>I am always shocked by how few locally designed websites in Bangkok validate. Validation is a relatively simple process which allows you to easily check the code of your website to make sure that it meets the latest standards.</p>
<p>I have found that the best service to use for validation is <a href="http://validator.w3.org">http://validator.w3.org</a>.</p>
<p>It is an excellent way for clients to check potential web design companies to see whether their knowledge of websites and coding goes further than just the surface &#8211; simply check the web design company&#8217;s own website!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/validation/website-html-and-css-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding jQuery To Your Website</title>
		<link>http://www.designchemical.com/blog/index.php/jquery/adding-jquery-to-your-website/</link>
		<comments>http://www.designchemical.com/blog/index.php/jquery/adding-jquery-to-your-website/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 12:15:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Design Tips]]></category>
		<category><![CDATA[Website Coding]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.designchemical.com/blog/?p=123</guid>
		<description><![CDATA[<p>The <a href="http://www.jquery.com" class="external">jQuery javascript library</a> offers an excellent and easy way for both experienced and beginner web designers and website owners to add great effects or features to any site.</p>
<p>The jQuery website contains hundreds of plugins, which allow&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.jquery.com" class="external">jQuery javascript library</a> offers an excellent and easy way for both experienced and beginner web designers and website owners to add great effects or features to any site.</p>
<p>The jQuery website contains hundreds of plugins, which allow you to quickly add elements to your website such as web photo galleries, navigation, animation, slideshows, mp3 players, AJAX and many more. These plugins are usually well supported and come with downloadable demo files, which makes it easier to integrate the code into your own website.</p>
<p>Later on in our blog we will show examples of where Design Chemical use this excellent resource in our web design projects. However, before you can start using jQuery features you must first know how to add the library to your web page.</p>
<p>There are two ways to include the jQuery library file:</p>
<h3><strong>1. Upload The jQuery Library File to Your Server</strong></h3>
<p>With this method you hold the main jQuery library file on your web server. You can download the latest version from the <a href="http://www.jquery.com">jQuery website</a>.</p>
<p>Inbetween the head tags include the link to the jQuery file &#8211; make sure that the path is correct based on your file structure. Example &#8211; if you download the file &#8220;jquery-1.3.2.min.js&#8221; to subdirectory &#8220;js/&#8221; then use the following code:</p>
<pre class="brush: plain;">
&lt;script type=&quot;text/javascript&quot; src=&quot;/js/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
</pre>
<p>Then upload the jQuery library file (e.g. jquery-1.3.2.min.js) to your web server along with your edited web page.</p>
<p>Make sure that the code comes before any other jQuery code in your document head.</p>
<h3><strong>2. Download The jQuery Library File Directly From Google</strong></h3>
<p>Instead of holding the file locally you can have your web page download directly from the google code repository. Main advantages of this is that if your visitor has already visited a website that uses the same code then your site can utilise the locally cached copy, which improves your page loading time. With jQuery becoming more and more popular, this method provides a definite advantage.</p>
<p>To download directly from google simply include the following code inbetween your head tags:</p>
<pre class="brush: plain;">
&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot;&gt;&lt;/script&gt;
</pre>
<p>Upload your edited web page to your web server and that&#8217;s it!</p>
<p>Easy &#8230; now with the library included in your web page you are free to utilise the code to add great features to your web design. To see a sample of what jQuery can do click on one of the project images on our <a href="http://www.designchemical.com/portfolio.asp" title="Design Chemical Bangkok Web Design Portfolio">web design portfolio</a> to see a gallery sample in action.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designchemical.com/blog/index.php/jquery/adding-jquery-to-your-website/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
