View Full Version : Animated Collapse Div

10-24-2007, 04:30 PM
1) Script Title: Animated Collapse Div

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm

3) Describe problem: We have this script working (collapse + persistence) fine when using .htm files. However, the site we are wanting to add the script to is Coldfusion (.cfm). When I take the htm files that work fine and just change the file extension to .cfm ... the persistence doesn't work anymore (the animated collapse works fine using CF). It is setting the cookie, but then when it tries to retrieve the cookie value, it returns 'null'.

Any ideas?

Any assistance would be appreciated.

~*~*~* Heather

10-24-2007, 08:37 PM
in regards to the coldfusion document. it is one template that is being sent url parameters...i believe this is where the problem is. since the filename is the same it keeps writing over the pre-existing cookie data.

ie template.cfm?uniqueID=1

set cookie = template.cfm?uniqueID=1-cat=yes
then when you go to the next page it writes over cat=yes

am i on the right track??

~*~*~* Heather

10-24-2007, 11:47 PM
Yep, you're basically on the right track, assuming I am that is. :) Basically the script uses the page's URL as the name of the corresponding cookie, and URLs with parameters added may wreck things. Try replacing the below line in the .js file:

var uniquepageid=window.location.href.replace("http://"+window.location.hostname, "").replace(/^\//, "")

with the below instead:

var uniquepageid=window.location.pathname+(window.location.href.split("=")[1] || "")

Untested, but has a good shot at working. :)

10-29-2007, 07:16 PM
the solution you sent me did work :)

thanks so much.

~*~*~* Heather