animate () функция принимает следующие аргументы
(selector).animate({styles},speed,easing,callback)
Согласно приведенному выше синтаксису ваш код должен быть:
$(".window").animate({}, 5000, "swing", () => {
if (this.screenWidth >= 1281) {
console.log(this.screenWidth);
} else if(this.screenWidth >= 1025 && this.screenWidth <= 1280) {
console.log(this.screenWidth);
}
});