Results 1 to 4 of 4

Thread: Accordion Content script (v1.3) ... need some help

  1. #1
    Join Date
    May 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Accordion Content script (v1.3) ... need some help

    1) Script Title: Accordion Content script (v1.3)

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

    3) Describe problem:

    There are two CSS classes to be applied to the menue-header when it's collapsed and expanded; is it possible to add those classes to the menue-content as well, when it is collapsed/expanded? You have opened the content of the first header, for example; when expanding the second header's content, the collapsing content of the first header sould have another background-image/font-color/etc.

    P.S.: very nice script! Sorry for my lack of English.

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

    Default

    Sure, if you mean the same two CSS classes that are applied to the header, but to the content DIVs as well. Inside ddaccordion.js, find and add to the two functions expandit() and collapseit() with the lines in red:

    Code:
    	expandit:function($targetHeader, $targetContent, config, isclicked){
    		$targetContent.slideDown(config.animatespeed, function(){config.onopenclose($targetHeader.get(0), parseInt($targetHeader.attr('headerindex')), $targetContent.css('display'), isclicked)})
    		this.transformHeader($targetHeader, config, "expand")
    		$targetContent.addClass(config.cssclass.expand).removeClass(config.cssclass.collapse)
    	},
    
    	collapseit:function($targetHeader, $targetContent, config, isclicked){
    		$targetContent.slideUp(config.animatespeed, function(){config.onopenclose($targetHeader.get(0), parseInt($targetHeader.attr('headerindex')), $targetContent.css('display'), isclicked)})
    		this.transformHeader($targetHeader, config, "collapse")
    		$targetContent.addClass(config.cssclass.collapse).removeClass(config.cssclass.expand)
    	},

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    WiMu (05-25-2008)

  4. #3
    Join Date
    May 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    huh ... this does very "interesting" effects on my css I think I'll have to make some adjustments to get the intended look, but works great.

    Thanks

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

    Default

    You can always replace the variables config.cssclass.expand and config.cssclass.collapse with 2 literal CSS classes as well, different from those applied to the header, such as "opencontent" and "closedcontent".

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
  •