Dreamweaver Tutorial: Multiple Automatic Fading Slideshows

image

Monkeys, The Hash Key and Functions:

In a previous post I went through how to create an Automatic Fading Slideshow. This works really nicely on a site when trying to show off multiple images in a small space; however, as this jQuery gives the #slideshow a fixed width and height, if you are wishing to implement more than one slideshow on the same webpage of a different height/width, problems will occur.

For the following, I’ll be using the Monkey Around page from my website as the example, see link.

image

As I outlined in my previous post, for the jQuery Automatic Fading Slideshow to work, you need to reference jQuery itself within the <head> tags of your site, and some code that I’ve managed to find through DaBrook. This is done through <script> tags:

<script src=”http://code.jquery.com/jquery-1.5.min.js”></script>

<script src=”http://cdn.wideskyhosting.com/js/jquery.cycle.js”></script>

Following this is the .ready and .cycle functions of the slideshow, just like last time. However, this time you will need to copy and paste the code as many times as you wish to have Automatic Fading Slideshows on your site - I needed four for myself:

<script>

$(“document”).ready(function(){

$(“#slideshow1”).cycle()});

</script>

<script>

$(“document”).ready(function(){

$(“#slideshow2”).cycle()});

</script>

<script>

$(“document”).ready(function(){

$(“#slideshow3”).cycle()});

</script>

<script>

$(“document”).ready(function(){

$(“#slideshow4”).cycle()});

</script>

Notice that every different function has a different #slideshow number (e.g. #slideshow1, #slideshow2 etc.), this is important as it relates to every slideshow on the site. Just after writing the functions of the slideshows, you must designate their width and height, still in the <head> tags:

<style>

#slideshow1{width:408.269px; height:568px;}

#slideshow2{width:385px; height:568px;}

#slideshow3{width:408.269px; height:568px;}

#slideshow4{width:385px; height:568px;}

</style>

image

What’s next is inserting your images into your slideshow. As each slideshow was named differently, you must make sure that you reference the correct slideshow in the correct place. From here it is a case of inserting a <div> with the characteristics of the appropriate #slideshow - and then filling it with the images (that must all be a uniform size, the size that you gave your slideshow):

<div id=”slideshow1”>

<img src=”images/monkeyss1_1.gif” alt=”Glasses Monkey Stage 1” />

<img src=”images/monkeyss1_2.gif” alt=”Glasses Monkey Stage 2” />

<img src=”images/monkeyss1_3.jpg” alt=”Glasses Monkey Stage 3” />

</div>

This was a helpful learning curve for me, and I realised that coding is really down to logic, and once you gather a broader understanding of symbols and terminology, it is easier to alter and produce HTML effectively.

Fancy Eating Some 60-Year-Old Cereal?

Of course, it is the designs of the packaging that are 60 years old, not the cereal itself - that’d just be silly. In celebration of this year’s Jubilee festivities, Kelloggs have released all of their cereal how it used to be packaged when the Queen was first put on the Great British throne 60 years ago.

The designs have a brilliant retro feel to them, using more simplistic colour and design for the Kelloggs characters that we know today. This is a stark contrast to the more 3D-cartoon kind of style that decorates their packaging in 2012; I much prefer the paper cutout look of 60 years ago, I think that it adds a lot to the charm and design of the packages. I feel that Kellogg’s packaging is somewhat over-designed today, and that they can take a page out of their precursor’s book and reinstate this simplistic colour collage approach.

This was a fabulous way to celebrate the Queen’s Diamond Jubilee, and showed the creatives at Kellogg’s HQ to be outside-the-box thinkers, avoiding the ‘paste as many Union Jacks as you can over our current design’ approach that many manufacturers have gone with. Jolly good show Kellogg’s!