PDA

View Full Version : Desperate to sort out problem with Step Carousel



vix
07-06-2010, 08:05 PM
1) Script Title: Step Carousel

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...epcarousel.htm

3) Describe problem: I'm having trouble ensuring that the step carousel panel matches the link from the drop-down menu at the top of the page. If you, say, browse through the rings (http://www.jacksdesign.co.uk/rings/ellipse/JR15a-3xdrops18Y.php) up to, for example, panel 5 and then select rings from the drop-down menu; the panel remains on panel 5 but open's the first page above.

I need to sort this out, as it would be a bit confusing for someone browsing through the rings.

This happens will all other pages containing the stepcarousel.

Many thanks

Vicky

ddadmin
07-07-2010, 08:19 AM
Sorry for the delay in getting back to your older thread. Ok, try augmenting your links within the drop down menu with the code in red:


<a href="target.htm" onClick="stepcarousel.configholder['mygallery'].currentpanel=0">dfdf</a>

And change "mygallery" to the ID of your Carousel, in your case, "bottom". The value 0 int his case means to load the 1st panel. Altogether clicking on the link above loads the target page, then causes the 1st panel within the Carousel to be shown, instead of the last viewed persisted panel.

vwphillips
07-07-2010, 04:35 PM
not sure this is what Vicky wants
as the problem is pressing the browser back button

best to define the set of rings to display when the page loads

http://www.vicsjavascripts.org.uk/Demos/100701B.htm

bit rough at the moment but maybe the DD script can be modified, I tried but seemed easier to make from new

vwphillips
07-07-2010, 04:36 PM
The value 0 int his case means to load the 1st panel.

not sure this is what Vicky wants
as the problem is pressing the browser back button

best to define the set of rings to display when the page loads

http://www.vicsjavascripts.org.uk/Demos/100701B.htm

bit rough at the moment but maybe the DD script can be modified, I tried but seemed easier to make from new

jscheuer1
07-07-2010, 06:20 PM
Your problem arises because the step carousel is remembering where it was, but the content above the carousel is not.

The carousel does this with cookies. It would probably be a bad idea to disable that because then, when you get to a sub page for a specific ring, the carousel would then be in the wrong place. It wouldn't make sense to remember the page you were on, because then clicking on rings would do nothing, though that could be arranged and might be a better solution, depending upon your personal preference. Let me know.

What we can to do is prevent the carousel from reacting to the cookie, but only on 'home' ring page:

http://www.jacksdesign.co.uk/rings/ellipse/JR15a-3xdrops18Y.php

To do that, replace this on that page only:


<script language="JavaScript" src="../../js/stepcarousel_03.js" type="text/javascript"></script>

with:


<script type="text/javascript">
stepcarousel.setup({
galleryid: 'bottom', //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:false, moveby:1, pause:3000},
panelbehavior: {speed:500, wraparound:false, persist:false, scrolling:false},
defaultbuttons: {enable: true, moveby: 8, leftnav: ['../../images/arrow_left.gif', 10, 80], rightnav: ['../../images/arrow_right.gif', -30, 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(){
var config = stepcarousel.configholder['bottom'];
jQuery(window).unbind('unload');
jQuery(window).bind('unload', function(){ //clean up on page unload and set cookie
stepcarousel.resetsettings($, config);
stepcarousel.setCookie(config.galleryid+"persist", config.currentpanel);
jQuery.each(config, function(ai, oi){
oi=null;
})
config=null;
});
}
})
</script>