setting responsive in js function