There is no super simple way to do something like this. Some people like to use something called a “switch statement” in situations like this. For instance, the psuedocode you wrote in in you post would look like this written as a switch statement:
switch ( slider ){
case 1:
10
case 2:
25
case 3:
50
case 4:
100
default:
100//if the slider wasn't 1 ,2, 3, or 4
}
Im not sure if this is the exact syntax you would use for a switch statement in javascipt, and i actully don’t even know if there is a switch constuct in javascript….however, most modern programming languages do have a switch construct.
Personally, I would never use a swich statement, I prefer just using if statements….I feel that while code using switch statements might be more concise it is more-error prone because people don’t use them as often. Also, there are a bunch of other issues that crop up when you forget to use the “break” keyword peoperly within a switch statement, but I dont think I’ll elaborate on that one…
Anyway, if you REALLY want to use switch statements, check out wikipedia and read about them…
https://en.wikipedia.org/wiki/Switch_statement
~Colin
http://www.colinbraley.com