You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.
Hi, I want to be able to open the menu at a certain media query but am wondering how i would achieve this.
Currently using the following which is a click function to load the menu.
new mlPushMenu(document.getElementById('mp-menu'), document.getElementById('trigger'), {
type: 'cover'
I want to be able to execute mlPushMenu <768px. As follows...
// media query event handler
if (matchMedia) {
const mq = window.matchMedia("(max-width: 768px)");
mq.addListener(WidthChange);
WidthChange(mq);
}
// media query change
function WidthChange(mq) {
if (mq.matches) {
alert("hello im less than 768px");
// open slider menu here
}
}
Can anyone advise? Thanks.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, I want to be able to open the menu at a certain media query but am wondering how i would achieve this.
Currently using the following which is a click function to load the menu.
new mlPushMenu(document.getElementById('mp-menu'), document.getElementById('trigger'), {
type: 'cover'
I want to be able to execute mlPushMenu <768px. As follows...
// media query event handler
if (matchMedia) {
const mq = window.matchMedia("(max-width: 768px)");
mq.addListener(WidthChange);
WidthChange(mq);
}
// media query change
function WidthChange(mq) {
if (mq.matches) {
alert("hello im less than 768px");
// open slider menu here
}
}
Can anyone advise? Thanks.
The text was updated successfully, but these errors were encountered: