I want to set a variable to either .prev() or .next(), for example:
if(x == y)
var shift = '.prev()';
else
var shift = '.next()';
$("li.active").removeClass('active')shift.addClass('active');
I could probably get it working with eval() however it's a security hazard.
Am I missing something obvious?