Prova ad usare la sintassi corretta: screen.width (senza window.) (ribadisco: prova tu dato che io non ho tablet)