3.3.0 • Published 12 months ago

offcanvas v3.3.0

Weekly downloads
87
License
MIT
Repository
github
Last release
12 months ago

Javascript library for off canvas (mobile style) menus.

Installation

npm install offcanvas

or

yarn add offcanvas

Usage

Use the CSS that's shown on the example and customise to your needs. Keep width and translate similar.

HTML

<body>
 <div class="offcanvas-wrapper">
    <div class="offcanvas left" data-offcanvas="navleft">
      <p>this is the left nav</p>
    </div>
    <div class="offcanvas-content" data-offcanvas-content>
      <button type="button" data-offcanvas-trigger="navleft">Show left nav</button>
      <p>Diam nascetur a natoque gravida odio scelerisque vitae ante ligula est cum convallis ullamcorper suspendisse magnis rutrum dignissim. Lorem a amet faucibus suscipit suspendisse ultrices adipiscing vestibulum morbi nibh habitasse gravida orci condimentum magnis eleifend condimentum leo a quisque condimentum phasellus eros accumsan. Vestibulum ut vestibulum a tempor adipiscing nec fringilla semper purus nisl rhoncus a bibendum a at condimentum. Gravida facilisi cras vivamus et class habitant lacinia ridiculus laoreet parturient sapien pulvinar dui parturient sociis dis augue litora himenaeos ante. Ante nunc a augue nam ullamcorper nulla tortor et rhoncus non scelerisque adipiscing himenaeos a ullamcorper parturient vivamus donec vestibulum vel potenti ultrices diam leo ac a dignissim. A pharetra sagittis vestibulum a condimentum aliquam tristique tincidunt ad lacinia a quisque non a ante.</p>
    </div>
  </div>
</body>

If you are using a fixed element to stick a navigation to the top, you can add the attribute data-offcanvas-fixed so once the offcanvas is shown it doesn't go to the top due to transform causing fixed elements to be absolute. See the example for more information.

CSS

@import 'offcanvas/offcanvas.css';

JavaScript

import 'offcanvas';

A First + Third Project

3.3.0

12 months ago

3.2.2

3 years ago

3.2.1

3 years ago

3.1.1

4 years ago

3.1.0

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.1.0

6 years ago

2.0.1

7 years ago

2.0.0

7 years ago

2.0.0-beta.4

7 years ago

2.0.0-beta.3

7 years ago

2.0.0-beta.2

7 years ago

2.0.0-beta.1

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago