Monday, 9 September 2013

break loop command in .draggable function

break loop command in .draggable function

I have a for loop, and an if statement inside the for loop with a break
command. All of this is in a .draggable function. The break, seems to
prevent the .draggable from rerunning the loop again when my mousemoves. I
want the loop to break when it hits the right value, but then run again
from the beggining as I keep dragging.
the for loop is something like this:
for (i=1; i < 30, i +=1) {
if (myvariable == i) {
break;
}
}

No comments:

Post a Comment