Code Monkey home page Code Monkey logo

slide_menu's Introduction

slide_menu

slide menu

demo

Usage

include

<link rel="stylesheet" href="css/slide_menu.css">

<script src="javascript/slide_menu.js"></script>

html

Add in body

<div id="slide-menu" class="slide-menu-close">
    <div id="slide-menu-bg"></div>
</div>
<div id="slide-container" class="">
    <div id="slide-container-bg">
        <div class="head">
            <button id="slide_menu_trigger">OPEN</button>
        </div>
        <!-- add code -->
        <div id="bd">
            This is body
        </div>
    </div>
    <div id="push-open-layer"></div>
</div>

JavaScript

var slideMenu = new initSlideMenu({type: 'slide-over'});

// use click event trigger open menu
document.querySelector('#slide_menu_trigger').addEventListener(
    'click',
    function (e) {
        e.preventDefault();
        slideMenu.openMenu();
    }
);

API

var slideMenu = new initSlideMenu({type: 'slide-over'});
  • type(string)
    • menu open type
    • slide-over or slide-push

Method

  • openMenu

    • open menu
    • slideMenu.openMenu();
  • closeMenu

    • close menu
      • slideMenu.closeMenu();

slide_menu's People

Contributors

tedshd avatar

Stargazers

sun avatar  avatar YU-HSIN, CHEN avatar 張碧涵 avatar Joseph Chang avatar  avatar vincent.sue avatar  avatar OA Wu avatar

Watchers

 avatar 3licheung avatar

Forkers

thefirstweb

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.