<?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>DesignM.ag &#187; Tutorials</title>
	<atom:link href="http://designm.ag/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://designm.ag</link>
	<description>Articles and Resources for Web Designers</description>
	<lastBuildDate>Wed, 22 May 2013 07:28:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Building an Image Slideshow UI Switcher with jQuery</title>
		<link>http://designm.ag/tutorials/image-slideshow-ui-switcher-with-jquery/</link>
		<comments>http://designm.ag/tutorials/image-slideshow-ui-switcher-with-jquery/#comments</comments>
		<pubDate>Mon, 01 Apr 2013 01:11:58 +0000</pubDate>
		<dc:creator>Jake Rocheleau</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://designm.ag/?p=74641</guid>
		<description><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=74641&c=131647308' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=74641&c=131647308' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>A lot of newer e-commerce websites and blog archives have started organizing listings in various formats. The interface will feature a set of icons to switch between different views, such as thumbnails or full details. It can be a pleasing design aesthetic for many typical webpages where you need to share a lot of content which can also be easily indexed.</p>

<p>For this tutorial I want to demonstrate how we can build a slideshow UI switcher for a set of photos. Users have the ability to flip forward and backwards in the photos list, or choose a specific image from the thumbnail view. I believe this interface can work with almost any type of slideshow webpage layout. And if you are running a dynamic CMS then you could build a page template which includes dynamic images inside the unordered list element.</p><br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=74641&c=1628782553' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=74641&c=1628782553' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=74641&c=1137507559' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=74641&c=1137507559' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>A lot of newer e-commerce websites and blog archives have started organizing listings in various formats. The interface will feature a set of icons to switch between different views, such as thumbnails or full details. It can be a pleasing design aesthetic for many typical webpages where you need to share a lot of content which can also be easily indexed.</p>
<p>For this tutorial I want to demonstrate how we can build a slideshow UI switcher for a set of photos. Users have the ability to flip forward and backwards in the photos list, or choose a specific image from the thumbnail view. I believe this interface can work with almost any type of slideshow webpage layout. And if you are running a dynamic CMS then you could build a page template which includes dynamic images inside the unordered list element.</p>
<p><span id="more-74641"></span></p>
<p><a href="http://designm.ag/previews/slideshow-ui-switcher/"><img src="http://designm.ag/wp-content/uploads/2013/03/designmag-switcher-ui-tutorial-screen.png" alt="jquery thumbnails slideshow image slider switcher preview" class="imgborder" /></a></p>
<p><strong><a href="http://designm.ag/previews/slideshow-ui-switcher/">Live Demo</a></strong> &#8211; <strong><a href="http://designm.ag/downloads/slideshow-ui-switcher-codes.zip">Download Source Code</a></strong></p>
<h2>Getting Started</h2>
<p>There is not too much HTML worth going over, but the main section is focused on the thumbnail and slideshow views. These two content sections are separated by divs and use CSS to switch between the display styles.</p>
<pre>&lt;div id="thumbnails"&gt;
  &lt;ul class="clearfix"&gt;
	&lt;li class="first current"&gt;&lt;a href="photos/01-gob-painting.jpg"&gt;&lt;img src="photos/01-gob-painting-thumb.jpg"&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="photos/02-michael-bluth-penthouse.jpg"&gt;&lt;img src="photos/02-michael-bluth-penthouse-thumb.jpg"&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="photos/03-michael-bluth-marta.jpg"&gt;&lt;img src="photos/03-michael-bluth-marta-thumb.jpg"&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="photos/04-lucille-bluth-wink.jpg"&gt;&lt;img src="photos/04-lucille-bluth-wink-thumb.jpg"&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="photos/05-korean-boy-annyong.jpg"&gt;&lt;img src="photos/05-korean-boy-annyong-thumb.jpg"&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="photos/06-tobias-blue-man.jpg"&gt;&lt;img src="photos/06-tobias-blue-man-thumb.jpg"&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="photos/07-maeby-funke-model-home.jpg"&gt;&lt;img src="photos/07-maeby-funke-model-home-thumb.jpg"&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="photos/08-buster-lucille-penthouse.jpg"&gt;&lt;img src="photos/08-buster-lucille-penthouse-thumb.jpg"&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="photos/09-michael-tobias-lindsay.jpg"&gt;&lt;img src="photos/09-michael-tobias-lindsay-thumb.jpg"&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li class="last"&gt;&lt;a href="photos/10-michael-george-sr-bluth.jpg"&gt;&lt;img src="photos/10-michael-george-sr-bluth-thumb.jpg"&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt; &lt;!-- @end #thumbnails --&gt;

&lt;div id="mainimg"&gt;
  &lt;img src="photos/01-gob-painting.jpg" id="displayimg"&gt;
&lt;/div&gt;
</pre>
<p>Each of the thumbnails actually contain a majority of the markup which could allow us to include <a href="http://designm.ag/tutorials/how-to-build-an-hd-photo-gallery-using-schema-microdata/">schema microdata</a> handy for search engines. Each list item has an internal anchor link which points towards the full-scale image. Then when a user clicks we update the img tag inside <strong>#mainimg</strong>. This single img tag doesn&#8217;t really need extra attributes because it is a dynamic element. And so bots and webpage crawlers will have a difficult time distinguishing between the changes and it won&#8217;t help much with SEO anyways.</p>
<pre>&lt;div id="controls" class="clearfix"&gt;
  &lt;ul class="switcher"&gt;
    &lt;li&gt;&lt;a href="#" id="switch-slideshow" class="sel" title="Slideshow"&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#" id="switch-thumbnail" title="Thumbnails"&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;ul class="slides"&gt;
    &lt;li&gt;&lt;a href="#" id="keyleft" title="Previous"&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#" id="keyright" title="Next"&gt;&lt;/a&gt;&lt;/li&gt;
   &lt;/ul&gt;
&lt;/div&gt;
</pre>
<p>This small block of code is actually placed above the thumbnails and slideshow container. These represent the slider controls and we have two internal components. First are the left/right arrows for shuffling between the various images. Then you can change from slideshow to thumbnails which will hide the arrows, and you can then choose a new display image from the set.</p>
<p>Now the only extra documents I have included represent the CSS stylesheet and the UI switcher, along with a copy of jQuery included from Google&#8217;s Developer CDN. Also I have just added a small web font courtesy of <a href="http://www.google.com/webfonts/specimen/Gabriela">Google Web Fonts</a>.</p>
<h2>Designing the Layout</h2>
<p>Inside the whole wrapper div I have setup a unique container for the background and box shadows. Additionally the background tile is a repeating image from <a href="http://bgrepeat.com/bg_128-218">BG Repeat</a>. The interesting pieces focus on our control div, along with the thumbnails view listing.</p>
<pre>/* ui controls */
#controls {
  display: block;
  width: 100%;
  margin-bottom: 10px;
}

#controls .slides {
  width: 150px;
  height: 50px;
  position: relative;
  top: -6px;
  margin: 0 auto;
}

#controls .slides #keyleft {
  display: block;
  float: left;
  width: 48px;
  height: 48px;
  margin-right: 9px;
  background: url('../images/key_left.png') no-repeat;
}
#controls .slides #keyright {
  display: block;
  float: left;
  width: 48px;
  height: 48px;
  background: url('../images/key_right.png') no-repeat;
}
</pre>
<p>The arrow keys are designed using CSS background images and positioned to float next to each other. They are centered in the layout compared with the UI switcher icons, which are located to the right side. You will find this item contained inside the <strong>.switcher</strong> div element.</p>
<pre>#controls .switcher {
  width: 70px;
  float: right;
}

#controls .switcher #switch-slideshow {
  display: block;
  float: left;
  width: 30px;
  height: 30px;
  background: url('../images/sprites.png') no-repeat -3px 0;
}
#controls .switcher #switch-thumbnail {
  display: block;
  float: left;
  width: 30px;
  height: 30px;
  background: url('../images/sprites.png') no-repeat -30px 0;
}
#controls .switcher #switch-slideshow.sel {
  background-position: -63px 0;
}
#controls .switcher #switch-thumbnail.sel {
  background-position: -90px 0;
}
</pre>
<p>Using a single sprite sheet saves time and HTTP resources when loading the initial webpage. And setting a fixed height/width combo is the easiest way to manage and position elements. The buttons are fairly quick using jQuery means we can handle any binding event from the user. Now moving into the page layout we only have a single block of code pertaining towards the main slideshow image, along with a series of internal thumbnail selectors.</p>
<pre>/* page displays */
#thumbnails {
  display: none;
  padding-left: 60px;
}

#thumbnails li {
  display: block;
  float: left;
  margin-right: 12px;
  margin-bottom: 15px;
  padding: 0;
}
#thumbnails li a {
  margin: 0;
  padding: 0;
  width: 160px;
  height: 160px;
  float: left;
  border: 5px solid #e6eaf0;

}

#thumbnails li.current a {
  border: 5px solid #4978bf;

}

#mainimg {
  display: block;
  width: 600px;
  margin: 0 auto;
}
</pre>
<h2>Interactive jQuery</h2>
<p>The final major piece to this tutorial is my <strong>uiswitcher.js</strong> file. This will include all the major jQuery event handlers and functions to run on each situation. The code is a bit lengthy so I will examine it broken down into parts.</p>
<pre>  /**
   * Switching between slideshow and thumbnail views
   * we handle 2 different .on() events
   */
  $('#switch-slideshow').on('click', function(e){
    e.preventDefault();
    if(!$(this).hasClass('sel')) {
      $('ul.switcher li a').removeClass('sel');
      $(this).addClass('sel');

      // hide the thumbnails and display the slideshow
      $('#thumbnails').hide();
      $('#controls .slides').fadeIn(450);
      $('#mainimg').fadeIn(450, 'linear', function(){
        $('body').removeClass('thumbnail-view');
      });
    }
  });

  $('#switch-thumbnail').on('click', function(e){
    e.preventDefault();
    if(!$(this).hasClass('sel')) {
      $('ul.switcher li a').removeClass('sel');
      $(this).addClass('sel');

      // hide the slideshow and display thumbnails
      $('#mainimg').hide();
      $('#controls .slides').hide();
      $('#thumbnails').fadeIn(450, 'linear', function(){
        $('body').addClass('thumbnail-view');
      });
    }
  });
</pre>
<p>First you will notice a chunk of codes designated for handling click events onto either of the UI switcher buttons. They both check if the current icon is already selected, in which case the script doesn&#8217;t need to do anything. Otherwise the clicked icon is <strong>not</strong> selected and we remove the selection from both icons, then make the new one selected and fade in with the new image display content.</p>
<pre>  /**
   * Slideshow pagination using arrow keys which hide during thumbnail display
   * we use 2 different .on() handlers for both keys
   */
  $('#keyleft').on('click', function(e){
    e.preventDefault();
    var currentimg = $('#thumbnails ul li.current');

    if(!currentimg.hasClass('first')) {
      // if any other image except the first, then navigate backwards
      var newimg = $(currentimg).prev();
      var newimgsrc = newimg.find('a').attr('href');

      currentimg.removeClass('current');
      newimg.addClass('current');
      $('#displayimg').attr('src', newimgsrc);
    }
  });

  $('#keyright').on('click', function(e){
    e.preventDefault();
    var currentimg = $('#thumbnails ul li.current');

    if(!currentimg.hasClass('last')) {
      // if any other image except the last, then navigate forwards
      var newimg = $(currentimg).next();
      var newimgsrc = newimg.find('a').attr('href');

      currentimg.removeClass('current');
      newimg.addClass('current');
      $('#displayimg').attr('src', newimgsrc);
    }
  });
</pre>
<p>The next large chunk of codes will focus on user clicks for the two different arrow keys. When the active image also has a class of <strong>.first</strong> or <strong>.last</strong> then we know where to end the pagination. If you wanted to update this slideshow into a carousel then we could just move from the first image back to the last item and vice-versa.</p>
<pre>  /**
   * Selecting any thumbnail image will update the current photo
   * and reset the UI back to slideshow view
   */
  $('#thumbnails ul li a').on('click', function(e){
    e.preventDefault();

    if(!$(this).parent().hasClass('current')) {
      // if we click anything except the currently selected image
      var newimgsrc = $(this).attr('href');
      $('#displayimg').attr('src', newimgsrc);

      $('#thumbnails ul li').removeClass('current');
      $(this).parent().addClass('current');

      // updating the slideshow view after choosing a photo
      $('ul.switcher li a').removeClass('sel');
      $('#switch-slideshow').addClass('sel');

      $('#thumbnails').hide();
      $('#controls .slides').fadeIn(450);
      $('#mainimg').fadeIn(450, 'linear', function(){
        $('body').removeClass('thumbnail-view');
      });
    }
  });
</pre>
<p>Finally we need to handle whenever the user clicks onto any thumbnail image. The script will stop each anchor link from loading and check if the current thumbnail is already selected. If not then we make it the currently selected image and load this into the main slideshow display. We complete the function by re-animating the fade effect onto the slideshow div for a convenient user experience.</p>
<p><a href="http://designm.ag/previews/slideshow-ui-switcher/"><img src="http://designm.ag/wp-content/uploads/2013/03/designmag-switcher-ui-tutorial-screen.png" alt="jquery thumbnails slideshow image slider switcher preview" class="imgborder" /></a></p>
<p><strong><a href="http://designm.ag/previews/slideshow-ui-switcher/">Live Demo</a></strong> &#8211; <strong><a href="http://designm.ag/downloads/slideshow-ui-switcher-codes.zip">Download Source Code</a></strong></p>
<h2>Final Thoughts</h2>
<p>This tutorial is definitely a bit more advanced, yet not too difficult for a newer jQuery developer. All of the codes should be easily portable into another website by updating the IDs. And you can test or edit this interface by downloading a copy of my project source code. Additionally if you have further questions or ideas please let us know in the post discussion area.</p>
<br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=74641&c=857210066' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=74641&c=857210066' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></content:encoded>
			<wfw:commentRss>http://designm.ag/tutorials/image-slideshow-ui-switcher-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Build an iOS-Style Content Slider using jQuery</title>
		<link>http://designm.ag/tutorials/how-to-build-an-ios-style-content-slider-using-jquery/</link>
		<comments>http://designm.ag/tutorials/how-to-build-an-ios-style-content-slider-using-jquery/#comments</comments>
		<pubDate>Tue, 26 Feb 2013 04:31:07 +0000</pubDate>
		<dc:creator>Jake Rocheleau</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://designm.ag/?p=69574</guid>
		<description><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=69574&c=2008214717' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=69574&c=2008214717' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>There are loads of tutorials online which are related to dynamic slideshows and image galleries. Typically web developers have been using jQuery to enhance the media in these content sliders. Many other ideas have come to fruition and this has spurred a generation of brand new plugins for jQuery developers.</p>

<p>In this tutorial I want to focus on one of these plugins called <a href="http://iosscripts.com/iosslider/">iosSlider</a>. This is an open source project with numerous options for customizing your own media slideshow. This includes typical animations and effects for when the user clicks or hover over slideshow items. Additionally we will include some dynamic text as seen on the website demo. This UI style is perfect for improving the creativity of more generic or bland website layouts.</p>

<p><a href="http://designm.ag/previews/ios-content-slider/"><img src="http://designm.ag/wp-content/uploads/2013/02/slideshow-ios-slider-jquery-preview.png" alt="jquery plugin slideshow slides ios demo tutorial preview" class="imgborder" /></a></p>
<p><strong><a href="http://designm.ag/previews/ios-content-slider/">Live Demo</a></strong> - <strong><a href="http://designm.ag/downloads/iosslider-jquery-source-codes.zip">Download Source Code</a></strong></p><br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=69574&c=831662458' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=69574&c=831662458' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=69574&c=773145133' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=69574&c=773145133' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>There are loads of tutorials online which are related to dynamic slideshows and image galleries. Typically web developers have been using jQuery to enhance the media in these content sliders. Many other ideas have come to fruition and this has spurred a generation of brand new plugins for jQuery developers.</p>
<p>In this tutorial I want to focus on one of these plugins called <a href="http://iosscripts.com/iosslider/">iosSlider</a>. This is an open source project with numerous options for customizing your own media slideshow. This includes typical animations and effects for when the user clicks or hover over slideshow items. Additionally we will include some dynamic text as seen on the website demo. This UI style is perfect for improving the creativity of more generic or bland website layouts.</p>
<p><a href="http://designm.ag/previews/ios-content-slider/"><img src="http://designm.ag/wp-content/uploads/2013/02/slideshow-ios-slider-jquery-preview.png" alt="jquery plugin slideshow slides ios demo tutorial preview" class="imgborder" /></a></p>
<p><strong><a href="http://designm.ag/previews/ios-content-slider/">Live Demo</a></strong> &#8211; <strong><a href="http://designm.ag/downloads/iosslider-jquery-source-codes.zip">Download Source Code</a></strong></p>
<p><span id="more-69574"></span></p>
<h2>Getting Started</h2>
<p>First we want to create our bare HTML5 webpage and setup the core HTML structure. There are a lot of tags we need to include which relate to each image in the slideshow. Plus we are using custom headings and page text inside each of the sliding panels. But first we should take a peek at the document heading section.</p>
<pre>&lt;!doctype html&gt;
&lt;html lang="en-US"&gt;
&lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8"&gt;
  &lt;title&gt;iOS Slider Demo Page&lt;/title&gt;
  &lt;meta name="author" content="Jake Rocheleau"&gt;
  &lt;link rel="shortcut icon" href="http://designm.ag/favicon.ico"&gt;
  &lt;link rel="icon" href="http://designm.ag/favicon.ico"&gt;
  &lt;link rel="stylesheet" type="text/css" href="styles.css"&gt;
  &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" charset="utf-8" src="jquery.easing-1.3.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" charset="utf-8" src="jquery.iosslider.min.js"&gt;&lt;/script&gt;
&lt;/head&gt;
</pre>
<p>Take note that I am including a series of JS files to ensure that our plugin works to the maximum capacity. First is the latest jQuery library hosted by Google APIs. Then followed by <a href="http://gsgd.co.uk/sandbox/jquery/easing/">jQuery easing</a> and finally our iosSlider plugin codes. All of the working JavaScript has been added into the bottom of the HTML body inside <strong>&lt;script&gt;&lt;/script&gt;</strong> tags.</p>
<p>Moving on we should now examine the internal HTML and see how this works to generate the basic slideshow. By including a series of content wrappers the goal is to keep our widget fully responsive to display properly on mobile smartphones. The functionality is already built using jQuery so it is worth the extra HTML.</p>
<pre>&lt;div class="fluidHeight"&gt;
  &lt;div class="sliderContainer"&gt;
    &lt;div class="iosSlider"&gt;
      &lt;div class="slider"&gt;
        &lt;div class="item item1"&gt;
          &lt;div class="inner"&gt;
            &lt;div class="text1"&gt;&lt;span&gt;Touch Me.&lt;/span&gt;&lt;/div&gt;
            &lt;div class="text2"&gt;&lt;span&gt;Hardware accelerated using&lt;br&gt;CSS3 for supported iOS,&lt;br&gt;Android and WebKit&lt;/span&gt;&lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
</pre>
<p>The <strong>.fluidHeight</strong> class will ensure that our full wrapper keeps the same proportions of each internal image. The internal <strong>.sliderContainer</strong> is what will hold the photos and defines an area for the content to slide between. The <strong>.item</strong> class is what defines a unique sliding object and <strong>.inner</strong> is used for absolute positioning. The two text objects will fly in to be animated from the right side, and so we need to have them positioned on top of the photo at all times.</p>
<h2>Styling the Sliding Panels</h2>
<p>At the bottom of the sliding container after all the images have been listed we close the .slider div and lock them into a single box. Then outside I have added the various circle navigation buttons for users to click and switch between the different views automatically.</p>
<pre>&lt;div class="slideSelectors"&gt;
  &lt;div class="item selected"&gt;&lt;/div&gt;
  &lt;div class="item"&gt;&lt;/div&gt;
  &lt;div class="item"&gt;&lt;/div&gt;
  &lt;div class="item"&gt;&lt;/div&gt;
  &lt;div class="item"&gt;&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>This looks like a basic nav menu list and we could have stuck to using list items or definition lists, per the newer HTML5 documentation. But divs are cleaner and offer more control over the width and height, plus the size of the link items themselves. You can see how these are floated together inside the container which uses different CSS properties than the internal <strong>.item</strong> slides.</p>
<pre>.iosSlider .slider .item { width: 100%; height: 100%; padding: 5px 0 5px 0; }

.iosSlider .slider .item .inner {
  position: relative;
  top: 0;
  left: 0;
  width: 1024px;
  margin: 0 auto;
  height: 100%;
  box-shadow: 0 0 10px -5px #000;
  background-position: 50% 0;
  background-repeat: no-repeat;
}

.iosSlider .slider .item .inner .text1 {
  background: none repeat scroll 0 0 #000;
  opacity: 0;
  filter: alpha(opacity=0);
  position: absolute;
  right: 150px;
  top: 30px;
  padding: 5px 2px 0 7px;
}

.iosSlider .slider .item .inner .text1 span { color: #fff; font: 55px/70px Norican; padding: 0 8px; }

.iosSlider .slider .item .inner .text2 {
  background: none repeat scroll 0 0 #000;
  opacity: 0;
  filter: alpha(opacity=0);
  padding: 5px 7px 7px;
  position: absolute;
  right: 0;
  top: 100px;
}

.iosSlider .slider .item .inner .text2 span { color: #fff; font: 16px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; }

.sliderContainer .slideSelectors {
  position: relative;
  bottom: 20px;
  left: 0;
  width: 92%;
  margin: 0 4%;
  z-index: 1;
  height: 10px;
}

.sliderContainer .slideSelectors .item {
  float: left;
  width: 9px;
  height: 9px;
  border: 1px solid #000;
  background: #999;
  margin: 0 0 0 10px;
  opacity: 0.25;
  filter: alpha(opacity=25);
}

.sliderContainer .slideSelectors .selected {
  background: #000;
  opacity: 1;
  filter: alpha(opacity=100);
}
</pre>
<p>The inner span elements help to define unique font faces we are applying inside CSS. The original page demo includes a small TTF font <strong>Norican Regular</strong> which looks fantastic as a header. This can be included using CSS @font-face properties and setting up a new typeface style. Keep in mind that you can apply this same effect using any other TTF file based on <a href="http://www.dafont.com/">open GLP licensed fonts</a>.</p>
<h2>Merging with JavaScript</h2>
<p>By now the last major piece of the puzzle is how to implement this whole iOS Slider effect. We will be using a custom function based off the jQuery plugin file. We need to attach the selector onto our <strong>.iosslider</strong> container div which holds the other slider items.</p>
<pre>$(document).ready(function() {
  $('.iosSlider').iosSlider({
    desktopClickDrag: true,
    snapToChildren: true,
    navSlideSelector: '.sliderContainer .slideSelectors .item',
    onSlideComplete: slideComplete,
    onSliderLoaded: sliderLoaded,
    onSlideChange: slideChange,
    scrollbar: false,
    autoSlide: true,
    autoSlideTimer: 3300,
    infiniteSlider: true
  });
});
</pre>
<p>The method call is using <strong>$().iosSlider</strong> for the main function name. Inside we are passing a whole slew of parameters which pertain to this specific demo. The full documentation is listed on the <a href="http://iosscripts.com/iosslider/">official plugin website</a> where you can see each parameter name and the accepted datatype. There are 3 parameters which call external functions also defined inside my JavaScript code. If you want to save space these may be copied over into the jQuery plugin file, or saved into a new external JS file.</p>
<pre>function slideChange(args) {
  $('.sliderContainer .slideSelectors .item').removeClass('selected');
  $('.sliderContainer .slideSelectors .item:eq(' + (args.currentSlideNumber - 1) + ')').addClass('selected');
}

function slideComplete(args) {
  if(!args.slideChanged) return false;

  $(args.sliderObject).find('.text1, .text2').attr('style', '');

  $(args.currentSlideObject).find('.text1').animate({
    right: '100px',
    opacity: '0.8'
  }, 400, 'easeOutQuint');

  $(args.currentSlideObject).find('.text2').delay(200).animate({
    right: '70px',
    opacity: '0.8'
  }, 400, 'easeOutQuint');
}

function sliderLoaded(args) {
  $(args.sliderObject).find('.text1, .text2').attr('style', '');

  $(args.currentSlideObject).find('.text1').animate({
    right: '100px',
    opacity: '0.8'
  }, 400, 'easeOutQuint');

  $(args.currentSlideObject).find('.text2').delay(200).animate({
    right: '70px',
    opacity: '0.8'
  }, 400, 'easeOutQuint');
  slideChange(args);
}
</pre>
<p>These function calls mostly deal with animating the text and sliding image panels on each slide change. You can dig into the functions as I have copied them below. Please note that it is not imperative that you edit these at all. They should work fine unless you are updating class names, which are very minor changes anyways.</p>
<p><a href="http://designm.ag/previews/ios-content-slider/"><img src="http://designm.ag/wp-content/uploads/2013/02/slideshow-ios-slider-jquery-preview.png" alt="jquery plugin slideshow slides ios demo tutorial preview" class="imgborder" /></a></p>
<p><strong><a href="http://designm.ag/previews/ios-content-slider/">Live Demo</a></strong> &#8211; <strong><a href="http://designm.ag/downloads/iosslider-jquery-source-codes.zip">Download Source Code</a></strong></p>
<h2>Final Thoughts</h2>
<p>I do hope this tutorial may be of use to some web developers out there. Building a custom slider widget to work properly in modern browsers and smartphones is not easy. Many of the supported browsers for Android and iOS devices are advancing, too. This means we can expect support for greater ideas in the near future.</p>
<p>Along with my live demos feel free to grab a copy of the project source code. I have slimmed down the page to include a very minimal amount of CSS and HTML to keep this slideshow running. It should be easy to copy/paste into your own design and have it working quickly. But if you have additional thoughts or questions on the iosSlider plugin feel free to share with us in the post discussion area.</p>
<br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=69574&c=1364926088' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=69574&c=1364926088' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></content:encoded>
			<wfw:commentRss>http://designm.ag/tutorials/how-to-build-an-ios-style-content-slider-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Build an HD Photo Gallery using Schema Microdata</title>
		<link>http://designm.ag/tutorials/how-to-build-an-hd-photo-gallery-using-schema-microdata/</link>
		<comments>http://designm.ag/tutorials/how-to-build-an-hd-photo-gallery-using-schema-microdata/#comments</comments>
		<pubDate>Tue, 29 Jan 2013 03:15:17 +0000</pubDate>
		<dc:creator>Jake Rocheleau</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://designm.ag/?p=67820</guid>
		<description><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=67820&c=1436373903' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=67820&c=1436373903' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>There are plenty of benefits for developers who add Microformats or Microdata into their HTML markup. Search engines like Google or Yahoo! often look for this extra metadata when crawling new webpages. You can offer helpful attributes for text and media on the page, along with other information about people, businesses, ideas, projects, practically anything.</p>

<p>In this tutorial I would like to introduce <a href="http://schema.org/">Schema microdata</a> as applied into an HTML5 image gallery. The dynamic content is powered by a small bit of jQuery so we can display thumbnails and the full-scale image as well. The codes here may be copied and ported into various other layouts for displaying lightboxes or streaming video. It's a fun topic and offers a lot to those interested in learning!</p>

<p><a href="http://designm.ag/previews/microdata-gallery/"><img src="http://designm.ag/wp-content/uploads/2013/01/hd-gallery-photos-microdata-schema.png" alt="schema microdata html5 photo gallery tutorial preview" class="imgborder" /></a></p>
<p><strong><a href="http://designm.ag/previews/microdata-gallery/">Live Demo</a></strong> - <strong><a href="http://designm.ag/downloads/image-microdata-source-code.zip">Download Source Code</a></strong></p><br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=67820&c=2086239515' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=67820&c=2086239515' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=67820&c=137169788' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=67820&c=137169788' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>There are plenty of benefits for developers who add Microformats or Microdata into their HTML markup. Search engines like Google or Yahoo! often look for this extra metadata when crawling new webpages. You can offer helpful attributes for text and media on the page, along with other information about people, businesses, ideas, projects, practically anything.</p>
<p>In this tutorial I would like to introduce <a href="http://schema.org/">Schema microdata</a> as applied into an HTML5 image gallery. The dynamic content is powered by a small bit of jQuery so we can display thumbnails and the full-scale image as well. The codes here may be copied and ported into various other layouts for displaying lightboxes or streaming video. It&#8217;s a fun topic and offers a lot to those interested in learning!</p>
<p><a href="http://designm.ag/previews/microdata-gallery/"><img src="http://designm.ag/wp-content/uploads/2013/01/hd-gallery-photos-microdata-schema.png" alt="schema microdata html5 photo gallery tutorial preview" class="imgborder" /></a></p>
<p><strong><a href="http://designm.ag/previews/microdata-gallery/">Live Demo</a></strong> &#8211; <strong><a href="http://designm.ag/downloads/image-microdata-source-code.zip">Download Source Code</a></strong></p>
<p><span id="more-67820"></span></p>
<h2>Helpful Resources</h2>
<p>Before jumping into the code I want to provide just a couple of links related to microdata. This format is relatively new but also unanimously supported by all modern search engines. I found an excellent <a href="http://support.google.com/webmasters/bin/answer.py?hl=en&amp;answer=2413309">Google support article</a> related to schema markup for videos. Much of the same basic syntax can be applied to other Schema objects, too.</p>
<p><a href="http://www.google.com/webmasters/tools/richsnippets"><img src="http://designm.ag/wp-content/uploads/2013/01/google-webmasters-tools-schema.png" alt="Google structured data too" class="imgborder" /></a></p>
<p>Another helpful resource put out by Google is the <a href="http://www.google.com/webmasters/tools/richsnippets">Structured Data Testing Tool</a>. Here you can link to a live website URL or embed your own HTML content and Google will crawl through to pull out all the related metadata. From the examples dropdown menu there are a series of demos you may try out. This is a great tool for double-checking against all your hard work once it has been launched on the web. Or possibly even before launching.</p>
<h2>Structuring the HTML</h2>
<p>To get started I have created the typical files we need in any general webpage demo. Inside my <strong>index.html</strong> we will include a copy of jQuery along with a reference to the local stylesheet named <strong>styles.css</strong>. The header information is mostly familiar so let&#8217;s skip right down into the body content.</p>
<pre>&lt;body&gt;
  &lt;div id="w"&gt;
    &lt;nav id="thumbnails"&gt;
      &lt;ul class="clearfix"&gt;
        &lt;li itemscope itemtype="http://schema.org/ImageObject"&gt;
          &lt;a itemprop="contentURL" href="images/photo01_lamp_post.jpg"&gt;&lt;img itemprop="thumbnailUrl" src="images/photo01_thumb_lamp_post.jpg" alt="lamp post"&gt;&lt;/a&gt;
          &lt;meta itemprop="caption" content="lamp post"&gt;
          &lt;meta itemprop="publisher" content="http://www.flickr.com/photos/digitaltree515/4002436362/"&gt;
        &lt;/li&gt;
</pre>
<p>The top portion of our wrapper container is holding thumbnails for each of the larger images. These are pre-cropped and sized 100&#215;100 pixels. I have only copied over a single list item so that you can get the idea of how Schema markup appears in typical HTML.</p>
<p>We need to define what type of object are using within a container element wrapped around the content itself. Since I&#8217;ve setup an unordered list we may apply this onto each <strong>&lt;li&gt;</strong> tag. However normally you could just add an extra <strong>&lt;div&gt;</strong> tag around the contents.</p>
<p>The keyword <strong>itemscope</strong> is necessary to inform that we are defining a scope for a new item. The value is passed into itemtype as a full URL linking to Schema&#8217;s object documentation &#8211; in this case we are using an <a href="http://schema.org/ImageObject">ImageObject</a>. If you aren&#8217;t familiar with the various item properties it may be worth quickly scanning the documentation page.</p>
<h2>Applying Metadata</h2>
<p>One important concept to understand is that we can include related microdata information without having that content displaying on the page. Each list item has a URL to the thumbnail image and the anchor link pointing towards the full image. We can use both of these items to pull source links for the different itemprops &#8220;contentURL&#8221; and &#8220;thumbnailUrl&#8221;.</p>
<p>But there is so much more to offer in the way of SEO and search keywords. This is where we can use the  tag right inside the object block to store further properties about the image. Check out <a href="http://html5doctor.com/microdata/">this HTML5 Doctor post</a> discussing schema microdata within HTML markup. All the meta tags will be visible in the code but nothing will appear on the frontend of your webpage. This is great because you can reap all the benefits of additional metadata without needlessly cramming this text into your layout.</p>
<pre>&lt;li itemscope itemtype="http://schema.org/ImageObject"&gt;
  &lt;a itemprop="contentURL" href="images/photo03_grand_piano.jpg"&gt;&lt;img itemprop="thumbnailUrl" src="images/photo03_thumb_grand_piano.jpg" alt="grand piano antique"&gt;&lt;/a&gt;
  &lt;meta itemprop="caption" content="grand piano antique"&gt;
  &lt;meta itemprop="publisher" content="http://www.flickr.com/photos/paulomarquez/3492496989/"&gt;
&lt;/li&gt;
</pre>
<p>I have copied over another list item down the line so you can see how they share a very similar syntax. We are only utilizing 2 different meta tags for image properties. The first is a caption which is mirrored from the image&#8217;s alt text. Then I have included a reference link back to the original publisher on their Flickr page. Attribution is important and this is a great method for any type of creative commons media.</p>
<h2>Dynamic Images</h2>
<p>Now for this last bit I want to expand on how we can make load the full images dynamically. Since I have linked each thumbnail directly to the respective full-shot JPG we need to cancel this initially loading. Then we can replace all the inner page content with new links. Here is my sample code found after the unordered thumbnails list.</p>
<pre>&lt;div id="container"&gt;
  &lt;p class="source"&gt;&lt;strong&gt;Image Source:&lt;/strong&gt; &lt;a href="http://www.flickr.com/photos/digitaltree515/4002436362/" target="_blank" id="mainsource"&gt;http://www.flickr.com/photos/digitaltree515/4002436362/&lt;/a&gt;&lt;/p&gt;

  &lt;div id="fullimage"&gt;
	&lt;img src="images/photo01_lamp_post.jpg" width="1024" height="768"&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>I have added a full in-page link to the source just for users to have access on the frontend. This isn&#8217;t necessary for Google since we have already coded the information into Schema markup. And if you didn&#8217;t notice I actually haven&#8217;t added any properties into the larger image display. This is because all of the inner content is dynamic and will be constantly changing. It&#8217;s pointless to have this labeled using Schema and the best method is to keep everything together in one place.</p>
<pre>&lt;script type="text/javascript"&gt;
$(function(){
  $('#thumbnails ul li a').on('click', function(e){
    e.preventDefault();

    var fullurl = $(this).attr('href');
    var srcurl  = $(this).siblings('meta[itemprop="publisher"]').attr('content');

    $('#fullimage img').attr('src',fullurl);
    $('#mainsource').attr('href',srcurl);
    $('#mainsource').html(srcurl);
  });
});
&lt;/script&gt;
</pre>
<p>And finally here is my JavaScript block which I have added at the very bottom of the page. After stopping the links from loading we need to pull out values for the larger image URL and the Flickr source URL. Notice we are grabbing this value from the related meta tag using the attribute selector <strong>meta[itemprop="publisher"]</strong>. Afterwards we can update the inner content and keep it static until the user clicks again.</p>
<p><a href="http://designm.ag/previews/microdata-gallery/"><img src="http://designm.ag/wp-content/uploads/2013/01/hd-gallery-photos-microdata-schema.png" alt="schema microdata html5 photo gallery tutorial preview" class="imgborder" /></a></p>
<p><strong><a href="http://designm.ag/previews/microdata-gallery/">Live Demo</a></strong> &#8211; <strong><a href="http://designm.ag/downloads/image-microdata-source-code.zip">Download Source Code</a></strong></p>
<h2>Final Thoughts</h2>
<p>I do hope you enjoy this basic HTML/CSS/Schema demo and see how this can be applied into any typical website. Image galleries are very common amongst web developers and they are heavily supported by all standards-compliant browsers. However it becomes an issue when attempting to reorder the content so it&#8217;s easier for search engine crawlers to read.</p>
<p>In a comparison with Microformats I still feel that Schema.org Microdata can offer a better solution. Their documentation is far more advanced and there are a lot more approved specifications rather than drafts. This means you can work with dozens of various item types aside from images or even try creating your own! Schema is a wonderful HTML5 markup assistant and definitely worth ingraining into your typical work routine.</p>
<br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=67820&c=1913540832' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=67820&c=1913540832' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></content:encoded>
			<wfw:commentRss>http://designm.ag/tutorials/how-to-build-an-hd-photo-gallery-using-schema-microdata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Semantic 2-Column and 3-Column CSS Layouts</title>
		<link>http://designm.ag/tutorials/semantic-2col-3col-css-layouts/</link>
		<comments>http://designm.ag/tutorials/semantic-2col-3col-css-layouts/#comments</comments>
		<pubDate>Thu, 27 Dec 2012 14:42:55 +0000</pubDate>
		<dc:creator>Jake Rocheleau</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[hmtl5]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[layouts]]></category>
		<category><![CDATA[tuts]]></category>

		<guid isPermaLink="false">http://designm.ag/?p=67319</guid>
		<description><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=67319&c=224975315' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=67319&c=224975315' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>Website layouts are not the most difficult part of coding a typical design. But unfortunately there are still not many standards set in stone for creating multiple column-based layouts. These are often put together through various CSS methods, but the most supported designs are using fluid width containers.</p>

<p>In this tutorial I want to look over a series of different CSS column layouts. We can see how to build websites using floats and direct positioning. Most common websites will utilize 2 or 3 columns at most, so that is what we'll be focusing on. Along with these ideas you should feel comfortable trying out other CSS codes. There are new standards being written so frequently it can be difficult to gauge the best possible solution.</p><br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=67319&c=2068706107' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=67319&c=2068706107' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href='http://rss.buysellads.com/click.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=67319&c=1796307444' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264759&k=7b00119eaeee15661bc8c2a76269358e&a=67319&c=1796307444' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264759' target='_blank'>Advertise here with BSA</a></p><br /><p>Website layouts are not the most difficult part of coding a typical design. But unfortunately there are still not many standards set in stone for creating multiple column-based layouts. These are often put together through various CSS methods, but the most supported designs are using fluid width containers.</p>
<p>In this tutorial I want to look over a series of different CSS column layouts. We can see how to build websites using floats and direct positioning. Most common websites will utilize 2 or 3 columns at most, so that is what we&#8217;ll be focusing on. Along with these ideas you should feel comfortable trying out other CSS codes. There are new standards being written so frequently it can be difficult to gauge the best possible solution.</p>
<p><span id="more-67319"></span></p>
<h2>Absolute Position Fixed Columns</h2>
<p>Using my first example I want to demonstrate a common website theme which uses 2 sidebars along with a center body area. The 2 side columns will be set to a fixed width while the center content should be fluid as you resize the window. This can be accomplished using a single container for all 3 columns, then positioning each sidebar to the right and left sides.</p>
<p>
<pre style="overflow:scroll">&lt;div class="container"&gt;
  &lt;div id="left"&gt;
    left col.
  &lt;/div&gt;

  &lt;div id="content"&gt; &lt;h1&gt;here is some main text.&lt;/h1&gt;
  &lt;p&gt;here is a brief paragraph with some elongated text. we can see if it will break the lines and where the columns begin to appear.&lt;/p&gt;

  &lt;p&gt;Isn't this a neat little trick?&lt;/p&gt;
  &lt;/div&gt;

  &lt;div id="right"&gt;
    right col.
  &lt;/div&gt;
&lt;/div&gt;
</pre>
</p>
<p>I am also placing additional padding into the center div container. When we setup absolute positioning on the columns this will automatically remove that content from the natural document flow. So all our center content is setup using <strong>width: 100%</strong> and would fall behind these sidebar columns.</p>
<p>
<pre style="overflow:scroll">/**
 * html-css column layouts
 */
html { background: #f06; background: linear-gradient(45deg, #f06, yellow);
min-height: 100%; }
div { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }

.container { display: block; position: relative; max-width: 1000px; min-width: 550px; margin: 0 auto; }

#left { width: 220px; background:#c9c; position: absolute; left: 0; top: 0; height: 100%; }
#content { width: 100%; background: #fff; padding: 0px 220px; }
#right { width: 220px; background: #a4a; position: absolute; right: 0; top: 0; height: 100%; }
</pre>
</p>
<p>Another nice part of using absolute positioning is that your sidebar columns will naturally fill the background space. Using other methods the sidebar BG colors will only be as long as the content. This is perfectly fine if all your background is the same color, but otherwise absolute positioning is a very solid method. I&#8217;ve setup a <a href="http://dabblet.com/gist/4296635">gist sample demo</a> if you want to see this live in your browser.</p>
<p><a href="http://dabblet.com/gist/4296635"><img src="http://designm.ag/wp-content/uploads/2012/12/01-absolute-position-columns-css-layout.png" alt="absolute positioning CSS layots screenshot Gist" /></a></p>
<h2>Floated Columns</h2>
<p>While we are looking into the left/right layout style I want to bring up another solution. Floated elements are still kept inside the document flow, which is nice in certain instances. There is nothing wrong with absolute positioning except that it doesn&#8217;t always scale properly.</p>
<p>We can build the same type of layout using floats coupled with the same container element. However there are just a couple small issues which stand out in comparison. One major point is that you&#8217;ll need to code any sidebars above your main content area in the HTML DOM. No matter how you float these elements in the layout, you&#8217;ll need to have the sidebars appear first in the webpage content.</p>
<p>
<pre style="overflow:scroll">&lt;div id="wrapper"&gt;
&lt;div class="container"&gt;
  &lt;div id="right"&gt;
    right col.
    &lt;p&gt;here is a line.&lt;/p&gt;
    &lt;p&gt; and nother&lt;/p&gt;
    &lt;p&gt; and nother!!&lt;/p&gt;
    &lt;p&gt; gonna keep going.&lt;/p&gt;
    &lt;p&gt;heyoo&lt;/p&gt;
    &lt;p&gt;heyooooo&lt;/p&gt;
  &lt;/div&gt;

  &lt;div id="left"&gt;
    left col.
  &lt;/div&gt;

  &lt;div id="content"&gt; 

  &lt;h1&gt;here is some main text.&lt;/h1&gt;
  &lt;p&gt;here is a brief paragraph with some elongated text. we can see if it will break the lines and where the columns begin to appear.&lt;/p&gt;
  &lt;h2&gt;here is more big text and will this break the bank?? will it?? i dont really know to be honest.&lt;/h2&gt;
  &lt;p&gt;but let's find out folks.&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</pre>
</p>
<p>This is still perfectly semantic code because we&#8217;re only using HTML5 elements and attributes. It just gets weird presenting content into search engine crawlers, where your sidebar area locations appear slightly out of place. But the other pressing issue is that your sidebars will not adjust to 100% height if the body content is longer.</p>
<p>
<pre style="overflow:scroll">/**
 * html-css floated column layouts
 */
html { background: #f06; background: linear-gradient(45deg, #f06, yellow);
min-height: 100%; }
div { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }

#wrapper { max-width: 1000px; min-width:750px; margin: 0 auto; }
.container { height: 100%; float: left; background: #fff; }

#left { width: 220px; height: 100%; background:#c9c; float: left; }
#content {width: 100%; height: 100%; padding: 0 220px; background: #fff;  }
#right { width: 220px;  height: 100%; background: #a4a; float: right; }

.container { display: inline-block; }
.container:after {
    content: " ";
    display: block;
    height: 0;
    clear: both;
    overflow: hidden;
    visibility: hidden;
}
.container {
    display: block;
}
</pre>
</p>
<p>Unfortunately even appending a clearfix onto the container will not always fix this issue. The best solution is to create a single image 1px high and fill it repeating vertically down the page. This isn&#8217;t the most elegant solution, but it works if you need sidebars with differing backgrounds. Also you may consider this solution for similar layouts using 2 or 4 columns. Check out my <a href="http://dabblet.com/gist/4296933">related gist example</a> with the same HTML/CSS code.</p>
<p><a href="http://dabblet.com/gist/4296933"><img src="http://designm.ag/wp-content/uploads/2012/12/02-floated-columns-sidebars-css-layout.png" alt="sidebars floating css clearfix background height bugs" /></a></p>
<h2>Fluid Equal Height Columns</h2>
<p>My next layout style is actually derived from <a href="http://matthewjamestaylor.com/blog/equal-height-columns-cross-browser-css-no-hacks">Matthew James Taylor</a> who wrote an excellent piece on this topic. He explains how we can build columns which float and also have full 100% height for background colors. It requires adding a new container div for each of the columns, and then hiding any overflow content.</p>
<p>
<pre style="overflow:scroll">&lt;div id="wrapper"&gt;
  &lt;div id="container3"&gt;
    &lt;div id="container2"&gt;
        &lt;div id="container1"&gt;
          &lt;div id="col1"&gt;
            &lt;h1&gt;this is the right col&lt;/h1&gt;
            &lt;p&gt;i am just saying that this is crazy folks. just super crazy!!!!!!!&lt;/p&gt;
          &lt;/div&gt;
          &lt;div id="col2"&gt;Column 2&lt;/div&gt;
          &lt;div id="col3"&gt;Column 3&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>
</p>
<p>The code is very confusing if you don&#8217;t follow exactly what&#8217;s going on. We are basically pushing the first container way over to the right and then using relative positioning for the others. This means each of the containers is actually at 100% width but we display just a portion of each column. Then all the other content is hidden using the <strong>overflow</strong> property.</p>
<p>
<pre style="overflow:scroll">html { background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%; padding-top: 55px; }

#wrapper { display: block; max-width: 1100px; min-width: 700px; margin: 0 auto; }

#container3 { float: left; width: 100%; background: green; overflow: hidden; position: relative; }
#container2 { float: left; width: 100%; background: yellow; position: relative; right: 30%; }
#container1 { float: left; width: 100%; background: red; position: relative; right: 40%; }
#col1 { float: left; width: 26%;  position: relative; left: 72%; overflow: hidden; }
#col2 { float: left; width: 36%; position: relative; left: 76%; overflow: hidden; }
#col3 { float: left; width: 26%; position: relative; left: 80%; overflow: hidden; }
</pre>
</p>
<p>Now the biggest problem I&#8217;ve had using this solution is getting any column to stay fixed. The issue arises because the column background and the column content are two separate divs. So if we setup a fixed width on the content, our background color will slowly fade as you resize the window. This requires us to stick using percentages or possibly ems for measurement units.</p>
<p>Unless we can figure out a fixed-width solution this method is best used in fluid website layouts. And as mentioned earlier, you are able to customize this style using as many columns as you&#8217;d like. Check out the <a href="http://dabblet.com/gist/4298315">live gist demo</a> and attempt resizing the window to see what I&#8217;m talking about.</p>
<p><a href="http://dabblet.com/gist/4298315"><img src="http://designm.ag/wp-content/uploads/2012/12/03-fluid-3col-columns-web-layout-html-css.png" alt="CSS floating container layout matthew james taylor method gist dabblet" /></a></p>
<h2>Fluid-Fixed-Fixed Columns</h2>
<p>This will be my last example but it&#8217;s definitely a cool one. Instead of placing the sidebars to the left &amp; right sides I&#8217;ll show how we can float them both next to each other. Using this method it&#8217;s possible to setup any combination of fluid/fixed while still keeping your HTML content in the proper order.</p>
<p>
<pre style="overflow:scroll">&lt;div id="wrapper"&gt;
  &lt;div id="contentwrapper"&gt;
    &lt;div id="contentcolumn"&gt;
      &lt;div class="innertube"&gt;
        &lt;b&gt;Content Column: &lt;em&gt;Fluid&lt;/em&gt;&lt;/b&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  &lt;div id="leftcolumn"&gt;
    &lt;div class="innertube"&gt;
      &lt;b&gt;Left Column: &lt;em&gt;220px&lt;/em&gt;&lt;/b&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  &lt;div id="rightcolumn"&gt;
    &lt;div class="innertube"&gt;
      &lt;b&gt;Right Column: &lt;em&gt;220px&lt;/em&gt;&lt;/b&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  &lt;footer&gt;
    &lt;a href="http://www.google.com/"&gt;Googies&lt;/a&gt;
  &lt;/footer&gt;
&lt;/div&gt;
</pre>
</p>
<p>I have also incorporated a small footer element to demonstrate how you may clear further page content. Using my example we have a left content column which is fluid as you resize the window. Then both the sidebars are set to a width of 220px which doesn&#8217;t adjust on resize. The content area uses negative margins to limit the full page width. This stops content from appearing underneath the sidebars.</p>
<p>
<pre style="overflow:scroll">/**
 * CSS Liquid Layout (Fluid-Fixed-Fixed)
 */
html {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%; }

body { padding-top: 85px; }
#wrapper { margin: 0 auto; max-width: 1100px; min-width: 650px; background: #fff; }

#contentwrapper{float: left; width: 100%; margin-left: -220px; }

#contentcolumn { margin: 0 190px 0 220px; }
#leftcolumn { float: left; width: 220px; margin-left: -220px; background: #C8FC98;}
#rightcolumn { float: left; width: 220px; background: #FDE95E;}

footer { clear: left; width: 100%; background: black;color: #FFF;text-align: center;padding: 4px 0;}
footer a { color: #FFFF80;}

.innertube {margin: 10px; margin-top: 0; }
</pre>
</p>
<p>This is one of my favorite general layouts when it comes to more complicated column designs. It does require a bit of knowledge using CSS margins/padding but nothing overly difficult. It should be noted you can easily rearrange the two sidebars to appear on the left side by changing your HTML order, and adjusting margins accordingly. Here is <a href="http://dabblet.com/gist/4298655">my live gist example</a> of the typical 3-column fluid-fixed-fixed layout style.</p>
<p><a href="http://dabblet.com/gist/4298655"><img src="http://designm.ag/wp-content/uploads/2012/12/04-three-columns-sidebars-html-css-screenshot.png" alt="three column layout website design css code techniques" /></a></p>
<h2>Final Thoughts</h2>
<p>I hope this brief tutorial can be of use to web developers who need quick solutions for layout designs. The initial codes used to setup your website will become the foundation for each project going forward. You want to make sure the foundation is not only stable, but supported in all major web browsers.</p>
<p>Be sure to check out some of my demo examples sewn throughout this article. I have provided live demo examples for each column style and you may duplicate these layouts at your own will. It is my goal to provide easy code snippets for putting together websites on a whim. If you have additional ideas or questions feel free to share with us in the post discussion area below.</p>
<br /><p><a href='http://rss.buysellads.com/click.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=67319&c=1711459796' target='_blank' rel='nofollow'>
				<img src='http://rss.buysellads.com/img.php?z=1264760&k=7b00119eaeee15661bc8c2a76269358e&a=67319&c=1711459796' border='0' alt='' /></a></p><p><a href='http://buysellads.com/buy/sitedetails/pubkey/7b00119eaeee15661bc8c2a76269358e/zone/1264760' target='_blank'>Advertise here with BSA</a></p>]]></content:encoded>
			<wfw:commentRss>http://designm.ag/tutorials/semantic-2col-3col-css-layouts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 1/24 queries in 0.042 seconds using memcached
Object Caching 947/988 objects using memcached

 Served from: designm.ag @ 2013-05-22 13:07:54 by W3 Total Cache -->