Ok you can see the banner rotator in action on my mockup page The banner rotates every 10 seconds.
There are 4 files for this script:
First is a CSS file:
Code:
.stepcarousel{
position: relative; /*leave this value alone*/
border: 0px solid black;
overflow: scroll; /*leave this value alone*/
width: 690px; /*Width of Carousel Viewer itself*/
height: 200px; /*Height should enough to fit largest content's height*/
}
.stepcarousel .belt{
position: absolute; /*leave this value alone*/
left: 0;
top: 5px;
}
.stepcarousel .panel{
float: left; /*leave this value alone*/
overflow: hidden; /*clip content that go outside dimensions of holding panel DIV*/
margin: 0px; /*margin around each panel*/
width: 690px; /*Width of each panel holding each content. If removed, widths should be individually defined on each content DIV then. */
}
Second is a remote JavaScript reference:
http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
Third is the carousel viewer script:
http://www.oceanabyssaquatics.ca/redo/stepcarousel.js
And last but not least... the config javascript called carousel.js :
Code:
stepcarousel.setup({
galleryid: 'mygallery', //id of carousel DIV
beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
panelclass: 'panel', //class of panel DIVs each holding content
autostep: {enable:true, moveby:1, pause:7000},
panelbehavior: {speed:1500, wraparound:true, wrapbehavior:'slide', persist:true},
defaultbuttons: {enable: false, moveby: 1, leftnav: ['http://i34.tinypic.com/317e0s5.gif', -5, 80], rightnav: ['http://i38.tinypic.com/33o7di8.gif', -20, 80]},
statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
contenttype: ['inline'] //content setting ['inline'] or ['ajax', 'path_to_external_file']
})
Bookmarks