I have a jQuery draggable() function and on drag is executing several other functions based on an if. Something like this:
$("div.element").draggable({
drag: function() {
if (a=1){
function1();
}
if (a=2){
function2();
}
if (a=3){
function3();
}
}
});
There are many variables involved and I am looking to optimize this from the performance perspective point of view. Is it possible to make the draggable "know" what function to perform on drag without doing the if
checking each time. Something like on drag do just function2() and function3().
Thank you