You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
930 B
26 lines
930 B
6 years ago
|
(function ($, Drupal) {
|
||
|
Drupal.behaviors.mtWaypointsFixedHeader = {
|
||
|
attach: function (context, settings) {
|
||
|
$(context).find(".header-container .header").once('mtWaypointsFixedHeaderInit').each(function(index, item) {
|
||
|
var sticky = new Waypoint.Sticky ({
|
||
|
element: $('.header-container .header')[0],
|
||
|
stuckClass: 'js-fixed',
|
||
|
handler: function(direction) {
|
||
|
if (Waypoint.viewportWidth() > 752) {
|
||
|
$('body', context).toggleClass('onscroll');
|
||
|
} else {
|
||
|
$('body', context).removeClass('onscroll');
|
||
|
}
|
||
|
var topValue = $('body').css('padding-top');
|
||
|
$(".header.js-fixed").css("top", topValue);
|
||
|
},
|
||
|
offset: function() {
|
||
|
var offsetValue = parseInt($('body').css('padding-top')) - 1;
|
||
|
return offsetValue;
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
})(jQuery, Drupal);
|