PDA

View Full Version : Trouble with DD's Stepcarousel - going to wrong panel



vix
05-17-2010, 06:23 PM
1) Script Title: SepCarousel

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

3) Describe problem: I'm hoping to put a stepcarousel on a website. The problem I'm having is that randomly (it seems) when you click to view a new page, the panel will typically return to the first panel or the previous panel if you, say, select an item in panel 3 then move through to panel 6.

I hope that makes sense. I'm having real trouble describing my problem.

Would really appreciate some help with this.

URL: http://www.goodwebdesignuk.com/jacks/rings/ellipse/JR15a-3xdrops18Y.php

Cheers

Vicky

ddadmin
05-18-2010, 09:21 AM
Hmm I'm not sure I fully understand actually. Are you saying you want the script to always show the very first panel when the user goes to another page that also contains the carousel? If so disabling persistence inside the initialization code is what you want:


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},
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']
})

Set the value in red to false on all of the pages that contain the script.

vix
05-18-2010, 09:58 AM
Dear DD Admin

Thanks for your reply.

Sorry, I didn't explain very well. Quite the opposite. What I'm finding is that the panels return to the first one when I don't want them to. You will click on a ring on, say, panel 6 and you would hope that panel 6 would remain at the bottom of the page, but it goes back to panel 1 or sometimes another panel.

This happens quite randomly. Sometimes it works just fine and then out of the blue it will have the wrong panel at the bottom of the page.

Hope that explains better.

http://www.goodwebdesignuk.com/jacks/rings/ellipse/JR15a-3xdrops18Y.php

Cheers

Vicky

jscheuer1
05-18-2010, 10:56 AM
I see what you are talking about, but I'm not sure exactly why it's happening. I can see though that you are not staying on the same page, not even in the same folder. So what the carousel does would probably at least in part be dictated by the new pages you are loading.

You could possibly use cookies to make the carousel remember where it is from one page to the other. Or use AJAX or some other method like frames or an iframe to load your other content to the existing page. If the page doesn't change/refresh, the carousel should stay put.

jscheuer1
05-18-2010, 11:17 AM
OK, I see the problem. You are using a cookie as I suggested, the internal cookie from the script. But it's not written to set a cookie for the domain, just for the folder. We can easily make it a domain cookie. Open the stepcarousel.js file in a plain text editor like NotePad and find this function:


setCookie:function(name, value){
document.cookie = name+"="+value
},

Make it like so:


setCookie:function(name, value){
document.cookie = name+"="+value+"; path=/";
},

Save that and upload it (replace your existing stepcarousel.js with it).

It may take a little while to take effect, unless you delete all the folder specific cookies first and clear the browser's cache. To do that, close all instances of the browser. Then when you open the browser again, clear its cache (this varies from browser to browser), then navigate to the pages. If it appears that things are still messed up, refresh the pages it is happening on and close all instances of the browser again. After that, the changes should take effect.

vix
05-18-2010, 01:15 PM
Dear John

Thank you so much - you're a star. That's brilliant. Seems to be working perfectly now.

Cheers

Vicky