GithubHelp home page GithubHelp logo

maxulyanov / slidingmenu Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 1.0 595 KB

Magic sliding menu

Home Page: http://m-ulyanov.github.io/sliding-menu/

License: MIT License

CoffeeScript 23.67% CSS 22.17% HTML 54.16%
sliding-menu coffeescript javascript jquery slidingmenu menu-navigation me

slidingmenu's Introduction

SlidingMenu

Magic sliding menu

Getting started

  1. Include jQuery
  2. Include SlidingMenu files (js and css)
  3. Create SlidingMenu with your options after window load
<link rel="stylesheet" href="SlidingMenu.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="SlidingMenu.js"></script>
<script>
    $(window).on('load', function() {
    
      var $menu = $('.menu-example-id-1');
      var $items = $menu.find('.menu-example__item');
      new SlidingMenu({
        'menu': $menu,
        'items': $items,
      });
    
    })
</script>

Options

Required:

menu — Wrapper items menu (jQuery object)
items — Items menu (jQuery object)

Not required:

itemActiveClass — Active class current item menu (String). Default: 'active'
slidingClass — Custom class sliding element (String). Default: ' '
direction — Direction float sliding 'x' or 'y' (String). Default: 'x'
duration — duration animation in mc (Number). Default: 400

Callbacks

over — Call function during hover menu items
leave — Call function during leave from wrapper menu

<script>
$(window).on('load', function() {

  var $menu = $('.menu-example-id-1');
  var $items = $menu.find('.menu-example__item');
  new SlidingMenu({
    'menu': $menu,
    'items': $items,
  },
  {
    'over': over,
    'leave': leave
  });

  function over(current, data) {
    console.log('hover menu items')
  }

  function leave(current, data) {
    console.log('leave menu')
  }

});
</script>

Browser Support

All modern browsers and IE9+

Example

See detail example - SlidingMenu

slidingmenu's People

Contributors

maxulyanov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

oussoudreamer

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.