I'm trying to make an animation of $\displaystyle n\cos(\frac{1}{10}xy)$

Where n is the value changed by a slider.

I have the slider set from -4 to 4 with a step of .5

When I animate this, it's wonderful! When it gets to 4 however it jumps to -4.

Is there a way to make it where, when the slider gets to 4, it will start counting down with a step of -.5?

EDIT:

Never mind.

If you put the slider value in a trig function then make the slide limits high (say 300) it will act as if it is looping.

sin(n)*sin(x)