Results 1 to 2 of 2

Thread: Animated Collapsible DIV v2.01

  1. #1
    Join Date
    Jan 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Animated Collapsible DIV v2.01

    Question:

    In the example on your site, http://www.dynamicdrive.com/dynamici...edcollapse.htm, pressing the button toggles the state.
    Instead of the button, I would like to see a '+' to expand, and a '-' to close. This means the the gif also needs to be toggled. Can you suggest a way to do this?

    Thanks,

    Peter

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You don't really need any images, you could use a button:

    Code:
    <input type="button" 
    onclick="animatedcollapse.toggle('jason'); this.value = this.value == '+'? '-' : '+';" 
    value="+">
    If you want to use images:

    Code:
    <a href="#" onclick="animatedcollapse.toggle('jason');return false;" 
    ><img src="plus.gif" 
    onclick="this.src = /plus\.gif$/.test(this.src)? 'minus.gif' : 'plus.gif';" 
    alt=""></a>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •