Results 1 to 3 of 3

Thread: Animated Collapsible DIV v2.2, toggle event error

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

    Question Animated Collapsible DIV v2.2, toggle event error

    1) Script Title: Animated Collapsible DIV v2.2

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...suppliment.htm

    3) Describe problem:

    cant seem to get the ontoggle event handler to work on my page, http://www.imajeb.com.au/news.html. I'm trying to set it up so that the little triangle rotates as the div is expaned but all I seem to get is random image errors.

    This is the code as taken from my page and were I think the error is located:
    [CODE]
    <script type="text/javascript">
    animatedcollapse.addDiv('b19040901', 'fade=0,speed=400,group=blog,hide=1')
    animatedcollapse.ontoggle=function($, divobj, state){
    if (divobj.id=="b19040901") document.getElementById(divobj.id+"-toggle").src=(state=="block")? "open.gif" : "close.gif"
    }
    animatedcollapse.init()
    </script>
    [CODE]

    I'm still new to this so still learning but I have been over it time and time again and am just missing something.

    Thanks in advance,
    Mitch.
    Last edited by mitchjburne; 06-04-2009 at 09:12 PM.

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

    Default

    Make sure the paths to the images are correct. I reckon they should be something like:

    Code:
    document.getElementById(divobj.id+"-toggle").src=(state=="block")? "graphics/open.gif" : "graphics/close.gif"
    DD Admin

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

    Default

    ah, thanks, I knew it was something stupid I was missing, I just couldnt figure it out...

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
  •