forked from olton/Metro-UI-CSS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
metro-pull.js
38 lines (27 loc) · 962 Bytes
/
metro-pull.js
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
(function( $ ) {
$.widget("metro.pullmenu", {
version: "1.0.0",
options: {
},
_create: function(){
var that = this,
element = this.element;
var menu = (element.data("relation") != undefined) ? element.data("relation") : element.parent().children(".element-menu, .horizontal-menu");
addTouchEvents(element[0]);
element.on("click", function(e){
menu.slideToggle();
e.preventDefault();
e.stopPropagation();
});
},
_destroy: function(){
},
_setOption: function(key, value){
this._super('_setOption', key, value);
}
})
})( jQuery );
$(window).resize(function(){
var device_width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
if (device_width > 800) {$(".element-menu").show();} else {$(".element-menu").hide();}
});