https://github.com/envato/jquery-expander
A jQuery plugin that toggles classes on two elements
https://github.com/envato/jquery-expander
Last synced: about 1 year ago
JSON representation
A jQuery plugin that toggles classes on two elements
- Host: GitHub
- URL: https://github.com/envato/jquery-expander
- Owner: envato
- Created: 2014-10-29T05:17:55.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-10-29T05:20:37.000Z (over 11 years ago)
- Last Synced: 2025-05-14T11:19:08.783Z (about 1 year ago)
- Language: CoffeeScript
- Homepage:
- Size: 109 KB
- Stars: 1
- Watchers: 38
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
jquery-expander
==============
A jQuery plugin that toggles classes on two elements.
### Usage
`$(element).expander()`
#### Options
* `target` - selector to find the target element. This needs to be inside the element the plugin is executed on. If the target is outside of the element the plugin is executed on you can use a data attribute `data-target="#target"` that will do a global DOM search
* `toggleClass` - class to toggle on the element (default `is-active`)
* `targetClass` - class name to toggle on the target element (default `is-hidden`)
```
$(element).expander({
target: '.target-element'
toggleClass: 'is-active',
targetClass: 'is-hidden'
})
```
### Development
* `npm install`
run `grunt` to watch for files for changes and run the CoffeeScript compilation and tests