PDA

View Full Version : stepcarousel persistence bug in IE



aragonne
01-11-2010, 09:49 AM
1) Script Title: Step Carousel Viewer v1.8

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

3) Describe problem:

This script works great but when using the persist:true option, IE does seem to be able to read the cookies correctly (the script works as expected in FF, Safari, and Chrome).

Working example at: http://stage.labtestsonline.org/
(The page currently pops up an alert box indicating the cookie values for debugging)

The carousel is being used to slide in the flags near the top of the page.

Steps to reproduce the problem on IE:

1. click on one of the red arrows on either side of the flags so that either the Australian (AU) flag is on the far left or the United Kingdom (UK) is on the far right.

2. click on any other links in the page. The state of the previous flag position does not persist. For example, if in step 1 above, you click the arrow so that UK is on the far right, then click on a link, the behavior is supposed to be so that the next page also displays UK on the far right. But instead the AU flag is displayed.

I checked the cookies stored for this domain and found the following:

1. undefined = 0
2. mygallerypersist = 3
3. flag_cookie = 1

Not sure where the undefined cookie is set but I suspect the stepcarousel script is setting it. The other two cookies are correct. Problem arises when the script tries to read the cookies. In IE, only the flag_cookie is found via the getCookie method of stepcarousel so the persistence (influenced by the mygallerypersist cookie) does not work.



I suspect there is an issue with the getCookie method in stepcarousel.js.

thanks,
Steve

ddadmin
01-12-2010, 10:16 AM
Hmm at a glance I don't see why it's behaving this way on your page. The default examples on DD work as they should in IE (IE8) when persistence it enabled. Looking at your page, it's quite possible another script on it is conflicting with the cookie function in some manner. Try duplicating your page, and start systematically removing the other scripts on your page to see if that changes anything. Also, revert the configuration code from the current:


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:2500},

panelbehavior: {speed:1000, wraparound:false, persist:true},

defaultbuttons: {enable: true, moveby: 3, leftnav: ['http://www.labtestsonline.org/images/redesign/common/flag_nav_left.gif', -9, 9], rightnav: ['http://www.labtestsonline.org/images/redesign/common/flag_nav_right.gif', -4, 9]},

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(){ // sliding effect here

jQuery('ul.belt').hide().css({"display" : "none", "left" : "700px"}).show().animate({"left": "-=700px"}, 5000);

}

});

}

/*

* no sliding (animate) and auto advance (autostep) of flags after first visit to page

*/

else {

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

panelbehavior: {speed:1000, wraparound:false, persist:true},

defaultbuttons: {enable: true, moveby: 3, leftnav: ['http://www.labtestsonline.org/images/redesign/common/flag_nav_left.gif', -9, 9], rightnav: ['http://www.labtestsonline.org/images/redesign/common/flag_nav_right.gif', -4, 9]},

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']

});

}


to just a single call (instead of one of two as you have above).