https://github.com/haggen/activate.js
Turn elements on and off.
https://github.com/haggen/activate.js
Last synced: 16 days ago
JSON representation
Turn elements on and off.
- Host: GitHub
- URL: https://github.com/haggen/activate.js
- Owner: haggen
- Created: 2015-03-21T00:02:30.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-21T00:40:51.000Z (almost 11 years ago)
- Last Synced: 2025-01-17T09:10:14.050Z (11 months ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Activate.js
> Turn elements on and off.
## About
- No dependency!
- [Turbolinks](https://github.com/rails/turbolinks) compatible!
- Flexible!
- Fast!
- IE8+
Fits perfectly for:
- Dropdowns
- Popovers
- Whatever!
## Usage
The handle:
```html
Splash!
```
The target:
```html
Splash! ×
```
That's it! Whenever you click on the handle it toggles the `active` attribute on the target, thus you can style it like that:
```css
.splash[active] {
/* ... */
}
```
Also, if you click either outside the target or on a element with the `deactivate` attribute, while active, it deactivates.
Don't believe me? [See it for yourself!](http://jsfiddle.net/apmkL087/)
## License
See [Attribution-ShareAlike 4.0 International](http://creativecommons.org/licenses/by-sa/4.0/)