Home arrow JavaScript arrow Page 3 - Building Slide Shows Using Progressive Enhancement
JAVASCRIPT

Building Slide Shows Using Progressive Enhancement


In this seventh part of the series, I develop a jQuery-driven slide show which uses the Cycle plug-in for performing the transitions between the sample images. While the fancy zooming effect applied to the images is carried out by the plug-in, it's worth noting that the images will remain visible even if the web page is displayed with JavaScript disabled. This demonstrates yet another case where Progressive Enhancement is applied with satisfying results.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
July 26, 2010
TABLE OF CONTENTS:
  1. · Building Slide Shows Using Progressive Enhancement
  2. · Review: using Progressive Enhancement when validating web forms
  3. · Building a simple slide show with jQuery
  4. · Adding behavior with jQuery's Cycle plug-in

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Building Slide Shows Using Progressive Enhancement - Building a simple slide show with jQuery
(Page 3 of 4 )

Considering that my goal here is to build a simple slide show using PE, the first thing we need to do is create the "regular" version of the application. Once that base is set, the slide show's dynamic behavior will be implemented afterward via jQuery.

Having clarified that point, here's how this sample slide show will look in its "slim" state:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Building a slide show using Progressive Enhancement</title>

<style type="text/css">

body {

padding: 0;

margin: 0;

background: #fff;

font: 0.8em Arial, Helvetica, sans-serif;

color: #000;

}

#wrapper {

width: 960px;

margin: 0 auto;

}

#header, #content, #footer {

padding: 20px;

}

#slideshow {

width: 370px;

height: 320px;

}

#slideshow img {

padding: 10px;

background: #ddd;

}

</style>

</head>

<body>

<div id="wrapper">

<div id="header">

<h1>Building a slide show using Progressive Enhancement</h1>

<h2>Header section</h2>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor commodo risus, et ultrices sapien vestibulum non. Maecenas scelerisque quam a nulla mattis tincidunt. Etiam massa libero, pharetra vel laoreet et, ultrices non leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed posuere ullamcorper lacus et sollicitudin. Morbi ultrices condimentum lacus, sit amet venenatis purus bibendum sit amet.</p>

</div>

<div id="content">

<h2>Slide show using the Cycle jQuery plug-in</h2>

<div id="slideshow">

<img src="./images/img1.jpg" width="350" height="300" alt="image 1" />

<img src="./images/img2.jpg" width="350" height="300" alt="image 2" />

<img src="./images/img3.jpg" width="350" height="300" alt="image 3" />

<img src="./images/img4.jpg" width="350" height="300" alt="image 4" />

<img src="./images/img5.jpg" width="350" height="300" alt="image 5" />

</div>

</div>

<div id="footer">

<h2>Footer section</h2>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor commodo risus, et ultrices sapien vestibulum non. Maecenas scelerisque quam a nulla mattis tincidunt. Etiam massa libero, pharetra vel laoreet et, ultrices non leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed posuere ullamcorper lacus et sollicitudin. Morbi ultrices condimentum lacus, sit amet venenatis purus bibendum sit amet.</p>

</div>

</div>

</body>

</html>

As you can see, the previous web page includes a div identified as "slideshow," which contains the five sample images shown in the first chapter of this series (you can download them from here). This is the initial structure of the slide show, whose images can be viewed in nearly every modern browser.

With that basic structure up and running, the next step we must take is to create the enhanced version of the slide show. In this case, we'll implement it via jQuery's Cycle plug-in. The full details of this process will be discussed in the following segment, so to get there click on the link below and keep reading.


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Tutorials for Beginners
- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials