-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
58 lines (49 loc) · 1.24 KB
/
script.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
(function( $, window ) {
$.fn.origamidMenu = function( options ) {
// Opções
var settings = $.extend({
breakpoint: 768,
top: 52,
color: 'white',
background: 'black'
}, options );
var mobileWidth = settings.breakpoint,
color = settings.color,
background = settings.background,
hambugerActive = false,
hamburger = '<a id="origamid-icon"></a>',
menu = $(this);
var menuFunction = function() {
var width = $(window).width();
if (width < mobileWidth) {
menu.attr('id', 'origamid-menu');
if(!hambugerActive) {
hambugerActive = true;
menu.before(hamburger);
} else {
return false;
}
} else if (width > mobileWidth) {
hambugerActive = false;
$('#origamid-icon').remove();
$('#origamid-menu style').remove();
menu.attr('id', '');
}
$('#origamid-icon').on('click touchstart', function(e) {
e.preventDefault();
$('#origamid-icon').toggleClass('active');
menu.toggleClass('active');
});
}
menuFunction();
$(window).resize(menuFunction);
};
}( jQuery, window ));
/* Hamburger Menu */
(function(){
$('ul').origamidMenu();
}());
/* Resposive Image Map*/
$(document).ready(function () {
$('map').imageMapResize();
});