PDA

View Full Version : Add a start index to Step Carousel Viewer v1.9?



tellisonii
11-01-2013, 11:03 PM
1) Script Title: Step Carousel Viewer v1.9

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/stepcarousel.htm

3) Describe problem: I was wondering if it would be possible to add a start index to this script so I can change which image would it start with on page load

jscheuer1
11-02-2013, 03:58 AM
Sure, just add the red part to the on page setup part of the script:


<script type="text/javascript">

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:3000},
panelbehavior: {speed:500, wraparound:false, wrapbehavior:'slide', persist:true},
defaultbuttons: {enable: true, 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']
oninit: function(){
stepcarousel.stepTo('mygallery', 3);
}
})

</script>

Where 'mygallery' is the galleryid and 3 is the index of the panel you want it to start with.

Don't miss the added comma (also red) after the contenttype property.

tellisonii
11-02-2013, 09:46 PM
thanks jscheuer1 for the obvious response. for some reason i completely forgot about this functionality. thanks again