sizing.js
945 Bytes
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
define(['jquery'], function($) {
"use strict";
var menuPosition = function () {
var imageHeight, imageBottomPosition;
var image = $('#home-image').offset();
if(image) {
imageHeight = $('#home-image').outerHeight(true);
imageBottomPosition = $('html').height() - (image.top + imageHeight);
if($('body').hasClass('logged-in')) {
$('#primary-nav').parent().css('bottom', imageBottomPosition +80);
} else {
$('#primary-nav').parent().css('bottom', imageBottomPosition + 50);
}
}
return false;
};
/**
* Add delay before set the position
*/
// setTimeout(function() {
// menuPosition();
//
// }, 200);
// $(window).resize(function() {
// /**
// * Adjust main menu position when window size is changed.
// */
// menuPosition();
// });
});