barebones/assets/scripts/scripts.js

28 lines
688 B
JavaScript
Raw Normal View History

2017-06-06 16:23:36 +02:00
import $ from 'jquery';
/**
* Mobile navigation toggle
2023-08-03 13:57:13 +02:00
* @param {mixed} event
*/
2019-01-08 11:52:31 +01:00
const toggleMenu = (event) => {
2019-01-08 11:52:31 +01:00
event.preventDefault();
2023-08-03 13:57:13 +02:00
$('.js-menu-toggle').toggleClass('open');
$('body').toggleClass('menu-open');
$('.header__navigation').fadeToggle();
};
2019-01-08 11:52:31 +01:00
$('.js-menu-toggle').on('click', toggleMenu);
2024-01-11 18:04:33 +01:00
const fullWidth = () => {
console.log('FullWidth: loaded;');
const windowWidth = $("body").prop("clientWidth");
const margin = - ((windowWidth - 1200) / 2) + 20;
$('.fullwidth').each(function(i, el) {
console.log($(this));
$(this).width(windowWidth);
});
};
$(window).on('load', fullWidth);
$(window).on('resize', fullWidth);