View Full Version : Step Carousel Viewer v1.9 make continual loop

05-13-2013, 03:44 PM
Hello DD

I am starting a new gallery again but before i do how can i make Demo #1 (link below) loop slowly, continually as well as having controls.

What do i need to edit in the Javascript?



05-13-2013, 05:06 PM
I'm not sure what you mean when you say "loop slowly" - the rotation speed or slide animation speed?

If you go to the bottom of the script demo page there is a table of parameters with descriptions/explanations for what they do.

The 2 parameters that affect speed (of different aspects of the script) are;
- "autostep", where you would edit the pause value to change the pause speed between rotations.
- "panelbehaviour", where you would edit the speed value to set the duration of the slide animations.
Change the value of each to get the speed effect you desire.

To make the slideshow rotate continuously, it looks like you would use the "panelbehaviour" parameter again and set the wraparound to true.

You will need to add the parameters to the JavaScript initialisation script if they are not already included but you can refer to the other demos to see how that's done.

The demos are pretty easy to setup though so copy and paste one into a sample page and fiddle with the settings (using the parameter descriptions for guidance) til you get the effect you're after.

For any more help, please setup your sample page and provide a link to that.

05-14-2013, 01:51 PM
You don't need to edit the javascript. As Beverley says, you need to setup the on page init of the gallery with the properties that you want, for example:

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:3000},
panelbehavior: {speed:500, wraparound:true, wrapbehavior:'slide', persist:true},
defaultbuttons: {enable: true, moveby: 1, leftnav: ['leftnav.gif', -5, 80], rightnav: ['rightnav.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']

The only thing you cannot setup there is to have it keep going after one of the nav or page images is clicked. To do that, add right after the on page init:

var mygal = stepcarousel.configholder.mygallery, $page = mygal.$paginatediv, $nav = mygal.$leftnavbutton.add(mygal.$rightnavbutton).add($page.find('img'));
mygal.steptimer=setInterval(function(){stepcarousel.autorotate(mygal.galleryid)}, mygal.autostep.pause);

Notice the red mygallery in both of these. It's the id of the gallery and must be the same in both places.



Use your browser's "View Source" to get the code.

Any questions, feel free to ask.

One thing this script cannot do though is move continuously from the last image to the first image. Well it can and does, but you might be thinking in terms of advancing to the first image. What it does is rewind to the first image. If you want a continuously advancing script, you would either need a (probably major) rewrite of this script or another script. There probably already is another script that does that. I'm just not sure which one(s) are available that do that.

But if you don't mind the rewind motion from last to first, after all it's what this script does, you're all set.