GithubHelp home page GithubHelp logo

drop-menu's Introduction

drop-menu

AngularJS 1.x dropmenu helper directives

Demo

How to use

(1) Install using bower

bower install angular-drop-menu --save

(2) Include drop-menu.js in your index.html, after including jQuery, jQuery UI and Angular (you can skip this if you use something like wiredep)

<!--next is for default location of the bower_components folder-->
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-drop-menu/drag_n_drop.js"></script>

(3) Add 'drop-menu' to your main module's list of dependencies

angular.module('myModuleName', ['drop-menu'])

CSS

You will need some css to show dropdown or dropup with desired styles and position. You can take one from the demo to start.

dmConfigProvider

If you want to configure default css classes and timeout you can use dmConfigProvider like this:

angular.module('myModuleName').config(['dmConfigProvider', function (dmConfigProvider) {
    dmConfigProvider.setOptions({
        hoverClass: 'hover',
        activeClass: 'active',
        timeout: 200
    });
}]);

dm-click-toggle

Adds css class to the element on click removes on click outside the element.

<button dm-click-toggle="className"></button>

dm-hover-toggle

Adds css class on hover and removes on mouse leave. Uses dm-timeout attribute to set the remove timeout if this attribute present on the same element.

<button dm-hover-toggle="className" dm-timeout="200"></button>

drop-menu's People

Contributors

kshutkin avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.