Hello everyone, I want this scroll function to be disabled for mobiles, or it will only be active if the width of the screen is 1200px up.
$(window).scroll(function () {
// Movimento primeiro box vermelho
if ($(this).scrollTop() >= $("#box_img1").offset().top - $("#marcador_menu").offset().top) {
$("#box_img1").stop().animate({"margin-right":"70px", "opacity":"1"},600);
$("#box_text1").stop().animate({"margin-left":"100px", "opacity":"1"},600);
} else {
}
if ($(this).scrollTop() >= $("#box_img2").offset().top - $("#marcador_menu").offset().top) {
$("#box_img2").stop().animate({"margin-left":"100px", "opacity":"1"},600);
$("#box_text2").stop().animate({"margin-right":"-50px", "opacity":"1"},600);
} else {
}
if ($(this).scrollTop() >= $("#box_img3").offset().top - $("#marcador_menu").offset().top) {
$("#box_img3").stop().animate({"margin-right":"50px", "opacity":"1"},600);
$("#box_text3").stop().animate({"margin-left":"100px", "opacity":"1"},600);
} else {
}
if ($(this).scrollTop() >= $("#box_img4").offset().top - $("#marcador_menu").offset().top) {
$("#box_img4").stop().animate({"margin-left":"100px", "opacity":"1"},600);
$("#box_text4").stop().animate({"margin-right":"-50px", "opacity":"1"},600);
} else {
}
if ($(this).scrollTop() >= $("#box_img5").offset().top - $("#marcador_menu").offset().top) {
$("#box_img5").stop().animate({"margin-right":"50px", "opacity":"1"},600);
$("#box_text5").stop().animate({"margin-left":"100px", "opacity":"1"},600);
} else {
}
});