1. INCLUDE JS FILES
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.touchSwipe.min.js"></script>
<script src="reelslideshow.js" type="text/javascript">
2. HTML
<div id="myreel"></div>
<div class="paginate">
≤ <a href="javascript:firstreel.navigate('back')" style="margin-right:200px;">back</a> <a href="javascript:firstreel.navigate('forth')">forth</a> ≥
</div>
3. JAVASCRIPT
var firstreel=new reelslideshow({
wrapperid: "myreel", //ID of blank DIV on page to house Slideshow
dimensions: [300, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["http://i26.tinypic.com/11l7ls0.jpg"], //["image_path", "optional_link", "optional_target"]
["http://i29.tinypic.com/xp3hns.jpg", "http://en.wikipedia.org/wiki/Cave", "_new"],
["http://i30.tinypic.com/531q3n.jpg"],
["http://i31.tinypic.com/119w28m.jpg"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2000, cycles:2, pauseonmouseover:true},
orientation: "h", //Valid values: "h" or "v"
persist: true, //remember last viewed slide and recall within same session?
slideduration: 300 //transition duration (milliseconds)
});
4. CSS
#myreel{ /*sample CSS for demo*/
border:15px solid black;
}
.paginate{
width: 330px;
margin-top:5px;
font:bold 14px Arial;
text-align:center;
}
5. OPTIONS
options |
Description |
wrapperid
Required
|
The ID of an empty DIV container on your page that will show the Reel Slideshow. Such a DIV on the page may look like this:
<div id="myreel"></div>
|
dimensions
Required
|
The dimensions of the slideshow in the format [width_int, height_int] with pixels being the assumed unit. These two values should be set to the dimensions of the largest image. Smaller images will be centered within the display area. *
*Vertical centering of each image does not work in IE6/7, only in IE8+ and all other modern browsers.
|
imagearray
Required
|
An array containing the images you wish to show. Each array element contains 3 parts:
["path_to_image", "optional_url", "optional_linktarget"]
The optional link and corresponding link target parameters can be left out entirely if not in use:
imagearray: [
["../dynamicindex4/fruits.jpg"],
["../dynamicindex4/pool.jpg", "http://en.wikipedia.org/wiki/Cave", "_new"],
["../dynamicindex4/autumn.jpg"],
["../dynamicindex4/dog.jpg"] //<--no trailing comma after very last image element!
],
Notice how there should be no comma trailing the very last element! The images do NOT have to be of the same dimensions- images smaller than the display area are centered, while those larger will be partially clipped. *
*Vertical centering of each image does not work in IE6/7, only in IE8+ and all other modern browsers.
|
displaymode
defaults to {type:'auto', pause:2000, cycles:2, pauseonmouseover:true}
|
Sets the primary attributes of your slideshow, from whether this is an automatic or manual slideshow, the pause between slides, the number of cycles before the slideshow stops in automatic mode, to whether the slideshow should pause onMouseover:
{type:'auto', pause:2000, cycles:2, pauseonmouseover:true}
The "type" option should be set to either "auto" or "manual", for automatic or manual rotation, respectively. In manual mode, you must define your own "back" and "forth" controls to let the user control the slideshow. See "togglerid" option below for more info.
The "cycles" option when set to 0 will cause the slideshow to rotate perpetually in automatic mode, while any number larger than 0 means it will stop after x cycles.
The "pausemouseover" option when set to true will cause the slideshow to pause when the mouse rolls over it in automatic mode.
|
orientation
Defaults to "h"
|
Set to either "h" or "v" to cause the slideshow to scroll the slides from left to right (horizontally), or up down (vertically) instead. |
persist
Defaults to true
|
Boolean variable that decides whether the slideshow should remember and recall the last viewed slide within a browser session when the page is reloaded. |
slideduration
Defaults to 500
|
The duration of the sliding effect when transitioning from one imag |
6. "BACK" AND "FORTH" LINKS
Whether your slideshow is set to automatically rotate or manually, you can easily add "back" and "forth" navigation buttons to explicitly move the slideshow in either direction. Simply call the two variants of the method scriptinstance.navigate(dir):
-
scriptinstance.navigate('back'): When called moves the referenced reel slideshow backwards by one slide.
-
scriptinstance.navigate('forth'): When called moves the referenced reel slideshow forward by one slide.
scriptinstance should be the name of the variable assigned to your Reel Slideshow when invoking it, such as:
var myreel=new reelslideshow({
wrapperid: "myreel", //ID of blank DIV on page to house Slideshow
dimensions: [300, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["image1.jpg"], //["image_path", "optional_link", "optional_target"]
["image1.jpg", "http://en.wikipedia.org/wiki/Cave", "_new"],
["image1.jpg"],
["image1.jpg"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2000, cycles:2, pauseonmouseover:true},
orientation: "h", //Valid values: "h" or "v"
persist: true, //remember last viewed slide and recall within same session?
slideduration: 300 //transition duration (milliseconds)
});
Here's an example of "back" and "forth" navigation buttons for the above slideshow:
<a href="javascript:myreel.navigate('back')" style="margin-right:200px;">back</a>
<a href="javascript:myreel.navigate('forth')">forth</a>