GithubHelp home page GithubHelp logo

isabella232 / offcanvas Goto Github PK

View Code? Open in Web Editor NEW

This project forked from firstandthird/offcanvas

0.0 0.0 0.0 700 KB

Javascript library for off canvas (mobile style) menus

License: MIT License

HTML 70.51% JavaScript 22.77% CSS 6.72%

offcanvas's Introduction

offcanvas

Lint Status NPM

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

offcanvas's People

Contributors

alejandroperezmartin avatar antonio-laguna avatar dawnerd avatar greenkeeper[bot] avatar jgallen23 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.