Results 1 to 4 of 4

Thread: Animated Collapse Div

  1. #1
    Join Date
    Oct 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Animated Collapse Div

    1) Script Title: Animated Collapse Div

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...edcollapse.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

  2. #2
    Join Date
    Oct 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default follow up

    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
    template.cfm?uniqueID=2
    template.cfm?uniqueID=3

    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

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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:

    Code:
    var uniquepageid=window.location.href.replace("http://"+window.location.hostname, "").replace(/^\//, "")
    with the below instead:

    Code:
    var uniquepageid=window.location.pathname+(window.location.href.split("=")[1] || "")
    Untested, but has a good shot at working.

  4. #4
    Join Date
    Oct 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    the solution you sent me did work

    thanks so much.

    ~*~*~* Heather

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •