Skip to main content

manipulate - How to use slider over an arbitrary list?



I have a list that has no definitive pattern or incremental difference. Can I make a Slider go over the items in the list?


For instance, here is an arbitrary list of six elements, can a Slider go from list[[1]] to list[[2]], etc.?


list = {0, 1, 2.22, 5, 141, 299};

Answer



You can achieve this by using both Dynamic and Slider:



{Slider[Dynamic[x], {list}], Dynamic[x]}

Comments