This repository was archived by the owner on Sep 5, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +26
-21
lines changed Expand file tree Collapse file tree 4 files changed +26
-21
lines changed Original file line number Diff line number Diff line change 1+
2+ /*
3+ * Dropdown menu.
4+ */
5+ ( function ( $ ) {
6+
7+ var dropdown = '.expand-dropdown' ;
8+ var employ = '.employ-toggle' ;
9+
10+ $ ( employ ) . on ( 'click' , function ( ) {
11+ $ ( dropdown ) . fadeToggle ( 'fast' ) ;
12+ $ ( dropdown ) . on ( 'click' , function ( e ) {
13+ if ( ! $ ( e . target ) . is ( employ ) && ! $ ( e . target ) . parents ( ) . is ( employ ) ) {
14+ $ ( dropdown ) . hide ( ) ;
15+ }
16+ } ) ;
17+ } ) ;
18+
19+ } ( jQuery ) ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " css-ui-dropdown-menu" ,
3- "version" : " 1.2.0 " ,
3+ "version" : " 1.2.1 " ,
44 "description" : " Simple dropdown menu." ,
55 "main" : " css/style.dropdown.css" ,
66 "repository" : {
1616 "url" : " https://github.com/css-ui/dropdown-menu/issues"
1717 },
1818 "dependencies" : {
19- "css-ui-simple" : " ^2.5.1 " ,
19+ "css-ui-simple" : " ^2.5.2 " ,
2020 "open-sans-fontface" : " ^1.4.0" ,
2121 "jquery" : " ^3.3.1" ,
2222 "font-awesome" : " ^4.7.0"
Original file line number Diff line number Diff line change @@ -68,20 +68,6 @@ javascript libraries and plugins.
6868
6969```html
7070<script src="path/to/jquery.js"> </script >
71- <script >
72- $(function() {
73- $('.employ-toggle ').on ('click ', function () {
74- var dropdown = '.expand-dropdown ';
75- $(dropdown ).fadeToggle ('fast ');
76- $(dropdown ).on ('click ', function (e ) {
77- var target = e .target ;
78- var employ = '.employ-toggle ';
79- if (!$(target ).is (employ ) && !$(target ).parents ().is (employ )) {
80- $(dropdown ).hide ();
81- }
82- });
83- });
84- });
85- </script >
71+ <script src="path/to/dropdown.menu .js"> </script >
8672```
8773Enjoy dropdown menu .
You can’t perform that action at this time.
0 commit comments