mmcollapse
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

mmcollapse

Version

another collapse plugin

Getting started

Install

Install with npm:

$ npm install mmcollapse

Install with yarn:

$ yarn add mmcollapse

Download

Download compiled CSS and JS

required files: "mmcollapse.js" and "mmcollapse.css" in dist folder.

Download source

Add project file to mmcollapse

// 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
<link rel="stylesheet" href="https://unpkg.com/mmcollapse/dist/mmcollapse.css">
<!-- OR -->  
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mmcollapse/dist/mmcollapse.css">
  1. Include mmcollapse plugin's code
<script src="https://unpkg.com/mmcollapse"></script>
<!-- OR -->
<script src="https://cdn.jsdelivr.net/npm/mmcollapse"></script>
  1. Create html
<div class="collapsibleElement">
...
</div>
  1. Call the plugin:
// create node
const collapsibleElement = document.querySelector('.collapsibleElement');

// create new instance
const mc = new MMCollapse(collapsibleElement);

API

show

show the collapsibleElement

mc.show();

hide

hide the collapsibleElement

mc.hide();

toggle

show/hide the collapsibleElement

mc.toggle();

Demo

demo page

Author

Osman Nuri Okumus

License

Copyright © 2020, Osman Nuri Okumus. Released under the MIT License.

Readme

Keywords

none

Package Sidebar

Install

npm i mmcollapse

Weekly Downloads

20

Version

0.0.2

License

MIT

Unpacked Size

27.5 kB

Total Files

15

Last publish

Collaborators

  • onokumus