Git Product home page Git Product logo

ng-accordion's Introduction

ng-accordion

Simple accordion directive for use in Angular apps.

Usage

<div class="myFirstAccordion"
	 ng-accordion
	 toggler-selector=".toggler"
	 section-selector=".section"
	 active-class="active"
	 one-at-a-time="false"
	 init-open-section=".two">
	<div class="section zero">
		<div class="toggler">Toggle!</div>
		<div class="content">Zero Content!</div>
	<div>
	<div class="section one">
		<div class="toggler">Toggle!</div>
		<div class="content">One Content!</div>
	<div>
	<div class="section two">
		<div class="toggler">Toggle!</div>
		<div class="content">Two Content!</div>
	<div>
	<div class="section three">
		<div class="toggler">Toggle!</div>
		<div class="content">Three Content!</div>
	<div>
</div>

Options

toggler-selector: the selector for the toggle button. (Default .ng-accordion-toggler)

section-selector: the selector the sections. (Default .ng-accordion-section)

active-class: Name of the active class. (Default ng-accordion-active)

one-at-a-time: Set to false if you don't want the sections to open one at a time. (No Default)

init-open-section: Selector for inital section(s) to have open. (No Default)

ng-accordion's People

Contributors

littlebigbot avatar till avatar bluemaex avatar rwos avatar

Stargazers

Israel Oliveira avatar

Watchers

Isam avatar Darshan Somashekar avatar Mario Scheliga avatar Brian Wiborg avatar  avatar James Cloos avatar  avatar

Forkers

marwahs zechtz

ng-accordion's Issues

Doesn't work correctly with dynamic content inside container

We tried to use it with ng-repeat directive inside and ng-accordion did not work correctly because:

  • init did not set active class (since there were no html by the time link() function called)
  • toggler did not exist yet, same reason as above.

We end up using different solution, just sharing it here, so others are aware of downsides.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.