Answer the question
In order to leave comments, you need to log in
How to set the default class at a specific resolution?
There is such a code that opens and closes the side menu, they asked to fasten the property so that when the screen width is < 1770px, the menu is already open by default. I understand what is being done in a couple of lines, but something goes wrong.
$('.leftcolumn__close-link').click(function() {
$('.leftcolumn').toggleClass('open');
$('#overlay').toggle();
$('body').toggleClass('position-fixed');
$('.leftcolumn').addClass('open');
})
$('#overlay').click(function() {
$('#overlay').hide();
$('.leftcolumn').toggleClass('open');
$('body').toggleClass('position-fixed');
})
$(document).ready(function(){
if ( $(window).width() < 1770) {
$('.leftcolumn').addClass('open');
}
});
Answer the question
In order to leave comments, you need to log in
This is a less than sign, put a >= sign (greater than equals), then even if the screen is exactly 1770, the section will be hidden
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question