Use :visible filter instead of checking offsetWidth