YUILibrary - Open source JavaScript and CSS for building richly interactive software.
Fork YUI on GitHub
  • Home
  • Gallery
  • Forums
  • YUI 2
  • YUI 3
  • YUI Labs
  • YUI Compressor
  • More
  • Gallery Forums
  • Gallery Stats
  • Gallery Calendar
  • Register
  • Login

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • FAQ
  • Developer FAQ
  • Developer Guide
  • Module Setup

Tag Cloud

nzakas plugin rgrove overlay port adam ericf skinnable widget lsmith foxxtrot caridy tivac jafl jacobfogg node ajax yui2 jsonp davglass apipkin form slideshow event animation io

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    Node Accordion (gallery-node-accordion) on cdn

    Last Updated: 08/21/10
    + 14 -

    Caridy Patino

    YUI Contributor

    See 7 more by this user.

    Featured Item

    Created: 10/27/09
    Last CDN Push: 05/21/10
    Build Tag: gallery-2010.05.21-18-16
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.1.2
    Free for use.
    Module Image

    Overview

    The Accordion Node Plugin makes it easy to transform existing markup into an accordion element with expandable and collapsible elements. Elements are easy to customize, and only require a small set of dependencies.

    To use the Accordion Node Plugin, simply pass a reference to the plugin to a Node instance's plug method.

    Usage

    // Call the "use" method, passing in "gallery-node-accordion". This will 
    // load the script and CSS for the Accordion Node Plugin and all of
    // the required dependencies.
    YUI().use("gallery-node-accordion", function(Y) {
    // Use the "contentready" event to initialize the accordion when
    // the element that represente the accordion
    // (<div id="accordion1">) is ready to be scripted.
    Y.on("contentready", function () {
    // Callback scope will be a Node instance for (<div id="accordion1">).
    // Therefore, since "this" represents a Node instance, it
    // is possible to just call "this.plug".
    this.plug(Y.Plugin.NodeAccordion);
    }, "#accordion1");
    });

    The Accordion Node Plugin has several configuration properties that can be set via an object literal that is passed as a second argument to a Node instance's plug method.

    // Including animation module to support smooth transitions 
    YUI().use("gallery-node-accordion", "anim", function(Y) {
    // Passing a second argument to customize some attributes
    Y.one('#accordion2').plug(Y.Plugin.NodeAccordion, {
    anim: true,
    effect: Y.Easing.backIn
    });
    });

    It also has several configuration properties that can be set via an object literal that is passed as a second argument to a Node instance's plug method. More attributes and other details here:

    • http://caridy.github.com/api/gallery-node-accordion/plugin.NodeAccordion.html

    Examples

    • Accordion using the default skin + Easing animation
    • Custom skin + custom properties
    • Horizontal Accordions (beta)

    Tests

    Run this test in your browser and report any issue.

    • http://caridy.name/sandbox/yui3-gallery/src/gallery-node-accordion/tests/node-accordion.html

    Note: Make sure you include OS, Browser Version and the test result from YUI Console in your ticket.

    • Tags:
    • caridy
    • accordion
    • plugin
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    Injecting node accordion plugin into a YUI 3 Node element.

    Code Sample

    <script src="http://yui.yahooapis.com/3.1.0/build/yui/yui-min.js"></script>
    YUI({
        //Last Gallery Build of this module
        gallery: 'gallery-2010.05.21-18-16'
    }).use('gallery-node-accordion', function(Y) {
     
        Y.one("#myaccordion").plug(Y.Plugin.NodeAccordion);
     
    });

    Forum Posts

    Subject Author Date
    Node accordion - works in 3.0.0, not in 3.1.0 henk b 04/13/10
    Re: Node accordion - works in 3.0.0, not in 3.1.0 Caridy Patino 04/18/10
    Re: Node accordion - works in 3.0.0, not in 3.1.0 henk b 04/21/10
    Death by Firebug John Bercik 06/10/10
    Re: Death by Firebug Caridy Patino 06/10/10
    YUI Projects
    • All YUI Downloads
    • YUI 2
    • YUI 3
    • YUI Doc
    • YUI Compressor
    • YUILibrary.com
    • YUI Build Tool
    • YUI PHP Loader
    YUI Labs
    • All YUI Labs Projects
    • Yeti
    Pages & Links
    • All YUI Downloads
    • Git FAQ
    • Graded Browser Support
    • Contribute to YUI
    • Forum Stats
    • Gallery Stats
    • YUI Calendar
    Contribute
    • Submit a Bug
    • Request a Feature
    • Write Code
    • Meet the Team
    Follow YUI
    • on GitHub
    • on Twitter
    • on FriendFeed
    • on Facebook
    • on IRC
    • YUI Blog
    • YUI Theater
    • YUI Forums

    © 2010 YUI Library - Site Credits