/
common.js
73 lines (63 loc) · 1.84 KB
/
common.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
(function($){
//transitionTime
var guruTransTime = 350,
maxWidth = 960;
$(document).ready(function(){
console.log('hello common ready');
$('html.ie').length ? Guru.ie = true : Guru.ie = false;
$('html.lte8').length ? Guru.lte8 = true : Guru.lte8 = false;
typeof WebKitPoint !== 'undefined' ? Guru.webkit = true : Guru.webkit = false;
});
// function autoMenu(){
// if ( $('nav#access').length ) {
//
// var nav = $('nav#access'),
// btn = $('<div />', { id: 'guruMenuBtn', html: '<span>Menu</span>' }),
// lis = nav.find('li');
//
// var sizeItUp = function(){
// if ( $(window).width() >= maxWidth ){
//
// //to make total item width
// var lisW = 0;
//
// lis.each(function(){
// lisW += $(this).width();
// });
//
// //now calculate the right margin for the lis
// var margin = Math.floor( ( nav.width() - lisW ) / (lis.length - 1) - 3 );
//
// lis.not(':last').css({ marginRight: margin });
//
// //console.log('fit those nav items', nav, nav.width(), lisW, margin);
// }
// };
//
// //button click handler
// var btnPress = function(e){
// console.log('btnPress', e);
//
// $(this).toggleClass('pressed');
// $(this).parent().find('.menu').toggle( 150 );
//
// };
//
// //attach handler to button and insert it into the dom.
// //btn.bind('mousedown mouseup', btnPress ).prependTo( nav );
// btn.bind('click', btnPress ).prependTo( nav );
//
// //size up the menu
// $(window).resize( sizeItUp );
// $(window).resize();
//
//
// //find the current_page item if it is a special post type archive
// lis.each(function(){
// if ( $(this).find('a').attr('href') === window.location.href ) {
// $(this).addClass('current-menu-item current_page_item');
// }
// });
// }
// }
})(jQuery);