Answer the question
In order to leave comments, you need to log in
How to make jquery function execute on mobile resolution only?
Good day!
There are such lines of jquery script. Which remove and add css classes when scrolling the page.
$(window).scroll(function() {
if($(this).scrollTop() > 40)
{
$('#nav1').removeClass('gbg');
$('#nav1').addClass('rounded-0 gbg2 py-1');
$('#nava').removeClass('btn-outline-danger');
$('#nava').addClass('btn-danger');
$('#loga').removeClass('wa100');
$('#loga').addClass('wa80');
} else {
$('#nav1').removeClass('rounded-0 gbg2 py-1');
$('#nav1').addClass('gbg');
$('#nava').removeClass('btn-danger');
$('#nava').addClass('btn-outline-danger');
$('#loga').removeClass('wa80');
$('#loga').addClass('wa100');
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question