CJ Flashy Slide Show 1.1.3

A JQuery Plugin That Gives Your Slide Shows Some Flash-Like Transitions

Project Description

CJ Flashy Slide Show is a JQuery plugin that allows you to create a photo slide show that has some "flash-like" transitional effects. The plugin has various settings which you can manipulate to achieve a multitude of effects, such as sizing, timing, transparency and shape style. Integration is a snap, you basically create a set of images and wrap it within a simple container. Unlike most Flash solutions you do not need to create an external XML file or embed your images within a hard-to-change Flash project.

This version is identical to CJ Flashy Slide Show 1.1.2, accept I've now added a variety of pre-defined presets. You still can pass the old variables to the code if you like, but I've noticed that I may have made things a little too complicated for a few users. This is my attempt to simplify things. If you would like to make your own presets or play around the various options, take a look at that version to see what all the options are.

Requirements

CJ Flashy Slide Show requires JQuery 1.4.2 or greater. I have tested this with version 1.3.2, but not anything older than that.

Implementing

Header Includes

Getting CJ Flashy Slide Show to work is really quite simple. The first thing you are going to need to do is include the jquery.cjFlashySlideshow-1.1.2.js file after your call to include JQuery. This is done in the header area of your web page. Typically you will do something like this:

<script src="jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="jquery-flashy-slideshow-1.1.2.js" type="text/javascript"></script>

Next, you will need to have a block container that contains a single or group of images. I've added line breaks <br> in my example, but it is not neccessary. I do this so the page looks somewhat presentable for any user who may not have a JavaScript or CSS capable web browser.

HTML

An important note about setting the image dimensions. The plugin will basically ignore the image width and height settings. So you need to make sure that your images are scaled and cropped exactly how you want them to display within the container. I might revisit this in a later version of the plug-in, but for now just make sure all your images are the same size.

Here's an example of what a container might look like. This code would be placed somewhere withing your web page's <body> section.

<div id="example">
   <img src="image_a.jpg" /><br />
   <img src="image_b.jpg" />
</div>
CSS

We now have to apply some CSS rules to our container. Nothing to fancy or complicated, just a few key elements that are going to be required by the plugin. You need to set the position of the block to either relative or absolute. Also you need to be sure to set the width and the height, as well has making sure that any overflow is hidden. The second rule is not required, but just to be sure, I've hidden all the line-breaks.

div#example {
   position: relative;
   display: block;
   width: 250px;
   height: 150px;
   overflow: hidden; 
}
div#example br { 
   display: none;
}
Initiating the Script

To get the slide show started, with the default preset (bricks) all you have to do is initiate the script like this:

<script type="text/javascript"><!--
$(function () {
   $(document).ready(function () {
      $('#example').cjFlashySlideShow();
   });
});
//-->
</script>

... or if you want to pass along one of the predefined presets, you would do something like this:

<script type="text/javascript"><!--
$(function () {
   $(document).ready(function () {
      $('#example').cjFlashySlideShow({
         preset: "cubism"
      });
   });
});
//-->
</script>

Presets

Below is a list of all the currently available presets. If you would like to create additional presets, post what you have in the comments below. I'll gladly give you credit!

Preset Description Default
bricks CJ Flashy Slide Show - BRICKS preset

Little bricks drop in from the top and expand to reveal the underlying image.
Yes
cubism CJ Flashy Slide Show - BRICKS preset

Random transparent blocks fly in from all sides to reveal the underlying image.
No
rain CJ Flashy Slide Show - BRICKS preset

Small rain drops fall from the top and expand to reveal the underlying image.

*This preset only works in browsers which supports CSS3 rules.
No
blinds CJ Flashy Slide Show - BRICKS preset

Evenly spaced and sized horizontal bands expand to reveal the underlying image.
No
blinds2 CJ Flashy Slide Show - BRICKS preset

Evenly spaced and sized vertical bands expand to reveal the underlying image.
No
transport CJ Flashy Slide Show - BRICKS preset

Random transparent horizontal bands expand to reveal the underlying image.
No
transport2 CJ Flashy Slide Show - BRICKS preset

Random transparent vertical bands expand to reveal the underlying image.
No

Release Notes

Version 1.1.3 is a minor release. The only difference between this version and 1.1.2 is the ability to pass presets.

5 responses to "CJ Flashy Slide Show 1.1.3"

James
Hi, nice work!

I can get version 1.1.1 to work just fine, but versions 1.1.2 and 1.1.3 do not work with the suggested script calls in this document.

Any ideas?
Doug
Doug responds:
@James - Hi James, If you have a link, I could take a look to see if I can see what's going on. It would also help to know what browser/os your trying it on.

Thanks
Scott
Love it!
One question: After i changed the image sizes (html&css) it started to bounce/drop 5px on each image swap. Any ideas?
Doug
Doug responds:
@Scott - Sounds like a CSS issue, but not 100%. Do you have a link you could send me to look at it? (You can use the contact form, if you don't want to post it here)
John S
John S says:
Hi Doug,

I LOVE this plugin... and was attempting to implement the "cubism" preset as an image rotator in the header of a site I'm working on. The only problem I encountered was that it doesn't appear to work in IE6 (or at least not in IE6 on the WinXP I've got running on VMWare). Funny thing is that the demo of the "cubism" preset works, just not my implementation.

Have any thoughts?

You can see the test site here: http://tinyurl.com/27ctqvh

Thanks!
Doug
Doug responds:
@John S - Unfortunately I don't have access to IE6 anymore. Maybe someone here can take a look and help out.

I'll take a look and see if I see anything obvious, but not sure if I can help or not.
Doug
Doug responds:
@John S - I didn't see any errors, which is good. Most likely it has something to do with the CSS. Can you strip everything down to just the CSS and HTML used for the slideshow and see if that works? Might help narrow down what's going on and it will be easier to debug if not.
John S
John S responds:
@Doug - Thanks for taking a look. I'll see what I can do to strip out any extraneous "stuff" and see if I can get it working in IE6. It may take a while, though... I ended up using some IF-THEN logic to just utilize a totally different slider/transition for those pesky IE6 users so that they got something other than a flash from slide-to-slide. Everyone else gets your CJ Flashy "cubism" loveliness (which I consider to be incentive to upgrade!).

Thanks!
Peter
Peter says:
This plugin is great! Love the effects... but, with v1.1.3, can you also combine individual parameters with the presets? I wanted to use the "cubism" preset, but wanted to increase the delay in the transition. I tried using 'preset: "cubism", delay: 6000', but it didn't seem to work.
Doug
Doug responds:
@Peter - No. When you use the presets, it overrides all the other settings. I may change this in the next revision, but for now you can open up the code and do a search for "cubism". You should see the setting for the delay and you can manually change it.
Peter
Peter responds:
@Doug - Thanks for the response. I'll take a peek inside the code to tweak the properties of the preset. But add me to any "wish list" users who also want to be able to over-ride preset settings inside the instantiation call. :)
klerbie
I am SO excited - thanks so much for this, I can now say that's I've officially utilized jQuery and it's awesome effects! Kudos : )

Have something to say? Leave a comment!

You don't have to be registered to leave a comment. Unregistered user's comments will be approved before going live.




You are currently posting as an unregistered user.
This means that your comment will be reviewed prior to going live. If you are a registered user, please . New user? No problem, register for an account, it's FREE! Benefits include, posting instantly, screen name protection, collaboration recognition, subscribe to article updates, and so much more!