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 1
1
{
2
2
"name" : " css-ui-dropdown-menu" ,
3
- "version" : " 1.2.0 " ,
3
+ "version" : " 1.2.1 " ,
4
4
"description" : " Simple dropdown menu." ,
5
5
"main" : " css/style.dropdown.css" ,
6
6
"repository" : {
16
16
"url" : " https://github.com/css-ui/dropdown-menu/issues"
17
17
},
18
18
"dependencies" : {
19
- "css-ui-simple" : " ^2.5.1 " ,
19
+ "css-ui-simple" : " ^2.5.2 " ,
20
20
"open-sans-fontface" : " ^1.4.0" ,
21
21
"jquery" : " ^3.3.1" ,
22
22
"font-awesome" : " ^4.7.0"
Original file line number Diff line number Diff line change @@ -68,20 +68,6 @@ javascript libraries and plugins.
68
68
69
69
```html
70
70
<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 >
86
72
```
87
73
Enjoy dropdown menu .
You can’t perform that action at this time.
0 commit comments