How would I go about making a category menu that will collapse on mobile view, but stays open on the desktop view?
1 Answer
You can use javascript code
function checkPosition() {
if (window.matchMedia('(max-width: 767px)').matches) {
$('.example').hide()
} else {
$('.example').show()
}
}
or you can use media query in css: https://www.w3schools.com/css/css_rwd_mediaqueries.asp