https://github.com/envato/jquery-exposer
A jQuery plugin that removes a class from some elements when some exposer is clicked
https://github.com/envato/jquery-exposer
Last synced: 10 months ago
JSON representation
A jQuery plugin that removes a class from some elements when some exposer is clicked
- Host: GitHub
- URL: https://github.com/envato/jquery-exposer
- Owner: envato
- Created: 2014-09-05T05:58:25.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-11-30T22:49:42.000Z (over 11 years ago)
- Last Synced: 2025-05-14T11:19:08.791Z (about 1 year ago)
- Language: CoffeeScript
- Size: 293 KB
- Stars: 1
- Watchers: 91
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
jquery-exposer
==============
A jQuery plugin that removes a class from some elements when some exposer is clicked, then destroys the exposer (or, optionally, its parent)
Use it to expose a bunch of hidden elements when a user clicks "show more"
Instantiate the plugin on an element that is a common parent of the exposer & exposee/s
### Usage
`$(element).exposer()`
#### Options
* `exposer` - element to bind the action to (default `.exposer`)
* `exposeeClass` - class name to remove (default `.hidden`)
* `destroyParent` - flag to destroy the target element's parent (default `false`)
* `parent` - element to remove instead of direct parent when you need more control, requires `destoryParent : true` (default `false`)
```
$(element).exposer({
exposer: '.item-faq-form__exposer',
exposeeClass: 'js-hidden'
})
```
##### Example with parent Options
```
$(element).exposer({
exposer: '.item-faq-form__exposer',
exposeeClass: 'js-hidden'
destroyParent: true,
parent: '.js-item-container'
})
```
### Development
* `npm install`
run `grunt` to watch for file changes and run the CoffeeScript compilation and tests