if x < change.pageX # pageX is cross-browser normalized by jQuery
val = Number(elem.text())
return elem.text(o.max) if val + o.step > o.max
return elem.text(o.min) if val + o.step < o.min
elem.text(val + o.step)
else x > change.pageX
# same thing, only - instead of +
(Coffee Script, but you get the idea). I'm looking for a trick to take a boolean and convert it to either 1 (true) or -1 (false). that way I can do val + converted_bool * o.step and save an if.
Sounds like a job for a conditional (ternary) operator