Coder Social home page Coder Social logo

matnex-mix / zeynepjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hsynlms/zeynepjs

0.0 1.0 0.0 130 KB

a lightweight multi-level jQuery side menu plugin

Home Page: https://codepen.io/hsynlms/pen/xMbGaO

License: MIT License

JavaScript 100.00%

zeynepjs's Introduction

zeynepjs

A lightweight multi-level jQuery side menu plugin.

NPM

zeynepjs can be initialized for any existing HTML element and supports multi-level nested submenus. It's customizable by CSS and options.

Options

Option Type Default Description
disableTransition boolean false Adds no-transition CSS class to the initialized HTML menu element
width int 295 Menu element width in pixel for animation
onLoading function null Triggered before loading the menu
onLoad function null Triggered when the menu is loaded
onOpening function null Triggered before opening the menu
onOpened function null Triggered when the menu is opened
onClosing function null Triggered before closing the menu
onClosed function null Triggered when the menu is closed
onUnloading function null Triggered before unloading/destroying the menu
onUnloaded function null Triggered when the menu is unloaded/destroyed
// initialize zeynepjs
var zeynep = $('.zeynep').zeynep({
  disableTransition: true,
  onClosed: function () {
    // enable main wrapper element clicks on any its children element
    $("body main").attr("style", "");

    console.log('the side menu is closed.');
  },
  onOpened: function () {
    // disable main wrapper element clicks on any its children element
    $("body main").attr("style", "pointer-events: none;");

    console.log('the side menu is opened.');
  }
});

Events

Events can be invoked after the menu initialized.

Option Description
open Opens the menu
close Closes the menu
unload Unloads/destroys the menu
// initialize zeynepjs and get the instance into a variable
var zeynep = $('.zeynep').zeynep();

// opens the menu
zeynep.open();

// closes the menu
zeynep.close();

// unloads/destroys the menu
zeynep.unload();

License

This project is licensed under the terms of the MIT license.

zeynepjs's People

Contributors

hsynlms avatar

Watchers

James Cloos 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.