Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/onokumus/mmcollapse
another collapse plugin
https://github.com/onokumus/mmcollapse
Last synced: about 2 months ago
JSON representation
another collapse plugin
- Host: GitHub
- URL: https://github.com/onokumus/mmcollapse
- Owner: onokumus
- License: mit
- Created: 2020-04-24T22:24:03.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-11T19:37:54.000Z (about 4 years ago)
- Last Synced: 2024-10-12T06:47:02.172Z (3 months ago)
- Language: TypeScript
- Homepage: https://onokumus.github.io/mmcollapse
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mmcollapse
[![](https://data.jsdelivr.com/v1/package/npm/mmcollapse/badge)](https://www.jsdelivr.com/package/npm/mmcollapse)
[![Version](https://img.shields.io/npm/v/mmcollapse.svg)](https://www.npmjs.com/package/mmcollapse)> another collapse plugin
## Getting started
### Install
Install with [npm](https://www.npmjs.com/):```sh
$ npm install mmcollapse
```Install with [yarn](https://yarnpkg.com):
```sh
$ yarn add mmcollapse
```
### Download
[Download compiled CSS and JS](https://github.com/onokumus/mmcollapse/releases/download/v0.0.2/mmcollapse-0.0.2-dist.zip)
> required files: "mmcollapse.js" and "mmcollapse.css" in dist folder.[Download source](https://github.com/onokumus/mmcollapse/archive/master.zip)
#### Add project file to mmcollapse
```js
// import es6 module
import MMCollapse from 'mmcollapse';// or commonjs
const MMCollapse = require('mmcollapse');// create node
const collapsibleElement = document.querySelector('.collapsibleElement');
// create new instance
const mc = new MMCollapse(collapsibleElement);
```## Usage
1. Include mmcollapse StyleSheet
```html
```2. Include mmcollapse plugin's code
```html
```3. Create html
```html
...
```4. Call the plugin:
```js
// create node
const collapsibleElement = document.querySelector('.collapsibleElement');// create new instance
const mc = new MMCollapse(collapsibleElement);
```## API
#### show
show the collapsibleElement
```js
mc.show();
```#### hide
hide the collapsibleElement
```js
mc.hide();
```#### toggle
show/hide the collapsibleElement
```js
mc.toggle();
```### Demo
[demo page](https://onokumus.com/mmcollapse)### Author
**Osman Nuri Okumus**
+ [GitHub Profile](https://github.com/onokumus)
+ [Twitter Profile](https://twitter.com/onokumus)
+ [LinkedIn Profile](https://linkedin.com/in/onokumus)### License
Copyright © 2020, [Osman Nuri Okumus](https://onokumus.com/).
Released under the [MIT License](LICENSE).