This repository was archived by the owner on Sep 5, 2019. It is now read-only.
File tree 4 files changed +33
-29
lines changed
4 files changed +33
-29
lines changed Original file line number Diff line number Diff line change
1
+
2
+ /*
3
+ * Responsive menu.
4
+ */
5
+ ( function ( $ ) {
6
+
7
+ // perfect scrollbar
8
+ new PerfectScrollbar ( '.scrollbar' ) ;
9
+
10
+ // click show/hide menu
11
+ $ ( '.nav .click' ) . on ( 'click' , function ( ) {
12
+ $ ( '.nav .responsive' ) . toggleClass ( 'expandable' ) ;
13
+ } ) ;
14
+
15
+ // responsive menu
16
+ $ ( 'ul.menu li' ) . each ( function ( ) {
17
+ if ( $ ( this ) . children ( 'li.parent a.current' ) . length > 0 ) {
18
+ $ ( this ) . parent ( ) . find ( 'ul.submenu' ) . toggle ( ) ;
19
+ $ ( this ) . parent ( ) . find ( 'li.parent a.employ' ) . addClass ( 'active' ) ;
20
+ }
21
+ } ) ;
22
+
23
+ // responsive active menu
24
+ $ ( 'ul.menu li a' ) . on ( 'click' , function ( ) {
25
+ $ ( this ) . parent ( 'li.parent' ) . find ( 'a.employ' ) . toggleClass ( 'active' ) ;
26
+ $ ( this ) . parent ( ) . find ( 'ul.submenu' ) . slideToggle ( 'fast' ) ;
27
+ $ ( this ) . parent ( ) . find ( 'ul.submenu ul.submenu' ) . toggle ( ) ;
28
+ } ) ;
29
+
30
+ } ( jQuery ) ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " css-ui-responsive-menu" ,
3
- "version" : " 3.1.3 " ,
3
+ "version" : " 3.1.4 " ,
4
4
"description" : " Simple responsive menu." ,
5
5
"main" : " css/style.menu.css" ,
6
6
"repository" : {
Original file line number Diff line number Diff line change @@ -143,33 +143,7 @@ javascript libraries and plugins.
143
143
```html
144
144
<script src="path/to/jquery.js"> </script >
145
145
<script src="path/to/perfect-scrollbar .js"> </script >
146
- <script >
147
- $(function() {
148
-
149
- // perfect scrollbar
150
- const ps = new PerfectScrollbar ('.scrollbar ');
151
-
152
- // click show /hide menu
153
- $('.nav .click ').on ('click ', function () {
154
- $('.nav .responsive ').toggleClass ('expandable ');
155
- });
156
-
157
- // responsive menu
158
- $('ul .menu li').each(function () {
159
- if ($(this ).children ('li .parent a .current ').length > 0 ) {
160
- $(this ).parent ().find ('ul .submenu ').toggle ();
161
- $(this ).parent ().find ('li .parent a .employ ').addClass ('active ');
162
- }
163
- });
164
-
165
- // responsive active menu
166
- $('ul .menu li a').on('click ', function() {
167
- $(this ).parent ('li .parent ').find ('a .employ ').toggleClass ('active ');
168
- $(this ).parent ().find ('ul .submenu ').slideToggle ('fast ');
169
- $(this ).parent ().find ('ul .submenu ul .submenu ').toggle ();
170
- });
171
- });
172
- </script >
146
+ <script src="path/to/responsive.menu .js"> </script >
173
147
```
174
148
175
149
Enjoy responsive menu .
You can’t perform that action at this time.
0 commit comments