I have a function like this:-
function dragMap(evt){
if (mousemode == 'pan'){
Snap('#zoombox').drag(move, start, stop);
}
}
dragMap();
My challenge is when variable mousemode changes to something else, e.g. mousemode == 'simple'
even then the following drag code continues to show its effect on dragging Element(#zoombox).
Snap('#zoombox').drag(move, start, stop);
I want that dragging shall work/execute ONLY WHEN variable mousemode is set to 'pan'. What should be way forward?