Repository navigation
Expand file tree
/
Copy pathscrollable.js
More file actions
179 lines (177 loc) · 4.98 KB
/
Copy pathscrollable.js
File metadata and controls
179 lines (177 loc) · 4.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/**
* Scrollable Menu sample
*/
this.default = function() {
// Menu items definition
var menuItems = [
{
text: 'Appliances',
id: 'appliances',
items: [
{
text: 'Kitchen',
items: [
{ text: 'Electric Cookers' },
{ text: 'Coffee Makers' },
{ text: 'Blenders' },
{ text: 'Microwave Ovens' }
]
},
{
text: 'Television',
items: [
{ text: 'Our Exclusive TVs' },
{ text: 'Smart TVs' },
{ text: 'Big Screen TVs' }
]
},
{
text: 'Washing Machine'
},
{
text: 'Refrigerators'
},
{
text: 'Air Conditioners',
items: [
{ text: 'Inverter ACs' },
{ text: 'Split ACs' },
{ text: 'Window ACs' },
]
},
{
text: 'Water Purifiers'
},
{
text: 'Air Purifiers'
},
{
text: 'Chimneys'
},
{
text: 'Inverters'
},
{
text: 'Healthy Living'
},
{
text: 'Vacuum Cleaners'
},
{
text: 'Room Heaters'
},
{
text: 'New Launches'
}
]
},
{
text: 'Accessories',
items: [
{
text: 'Mobile',
id: 'mobile',
items: [
{ text: 'Headphones' },
{ text: 'Batteries' },
{ text: 'Memory Cards' },
{ text: 'Power Banks' },
{ text: 'Mobile Cases' },
{ text: 'Screen Protectors' },
{ text: 'Data Cables' },
{ text: 'Chargers' },
{ text: 'Selfie Sticks' },
{ text: 'OTG Cable' }
]
},
{
text: 'Laptops'
},
{
text: 'Desktop PC',
items: [
{ text: 'Pendrives' },
{ text: 'External Hard Disks' },
{ text: 'Monitors' },
{ text: 'Keyboards' }
]
},
{
text: 'Camera',
items: [
{ text: 'Lens' },
{ text: 'Tripods' }
]
}
]
},
{
text: 'Fashion',
items: [
{
text: 'Men'
},
{
text: 'Women'
}
]
},
{
text: 'Home & Living',
items: [
{
text: 'Furniture'
},
{
text: 'Decor'
},
{
text: 'Smart Home Automation'
},
{
text: 'Dining & Serving'
}
]
},
{
text: 'Entertainment',
items: [
{
text: 'Televisions'
},
{
text: 'Home Theatres'
},
{
text: 'Gaming Laptops'
}
]
},
{
text: 'Contact Us'
},
{
text: 'Help'
}
];
// Menu model definition
var menuOptions = {
items: menuItems,
cssClass: 'e-custom-scroll',
// Allows to enable the scroll option
enableScrolling: true,
// Increased duration for smooth animation.
animationSettings: { duration: 800 },
beforeOpen: function(args) {
// Restricting sub menu wrapper height
if (args.parentItem.text === 'Appliances') {
ej.base.closest(args.element, '.e-menu-wrapper').style.height = '320px';
}
if (args.parentItem.text === 'Mobile') {
ej.base.closest(args.element, '.e-menu-wrapper').style.height = '260px';
}
}
};
// Menu initialization
new ej.navigations.Menu(menuOptions, '#menu');
};