code to generate the slider