Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Using animated collapsible DIV script in multiple locations throughout page

  1. #11
    Join Date
    Aug 2004
    Posts
    9,911
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    Quote Originally Posted by Gottaloveit View Post
    It would be great if the next version of the animated collapsible div would allow the div to be specified as a var, so that a dynamically generated page (I.e. a list of search results) could have an animated div for each result.
    If your page is dynamically generated, technically all HTML output are already output as variables according to your server side script. If you mean specifying the animated DIVs' HTML as JavaScript variables, there's no benefit to that, only disadvantages, as you have to make sure everything is escaped properly to avoid throwing JavaScript errors.

  2. #12
    Join Date
    Jun 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Interesting point!

    So is there a way with the current animated collapsible div script to allow each of my generated rows to have their own unique animated div? There will be about 50 or 75 rows per page... since the rows are generated from a mysql array, I'm not sure how to create unique divs for each of the rows. Currently the script works beautifully but only on the first row. Clicking the "show" link on any of the rows on the page only opens and closes the div in the first row (it looks beautiful though!)

    Thanks for any help,

    Jamie

  3. #13
    Join Date
    Jun 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Nevermind, I found a solution to dynamically generate a unique div for each row of generated content. The script that is normally placed in the head can instead be placed in a php include. that include can have a database query, and then print the javascript as an array, printing a new row of javascript for each database entry. The div name can just be the id for that row of the dynamic content. If anyone wants example code just send me an email.

  4. #14
    Join Date
    Jan 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Gottaloveit,
    I would like to have this example of your code. Please tell me how to find it. I'm brand new to the forum.

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
  •