making a simple javascript slider