I have this part of code:
if(mess <= 0 || mess < -width) {
img_container.find('ul').animate({'margin-left' : mess + 'px' }, 1000);
}
I need this to stop working when mess is lesser the -width. How can I do this?
See if you are getting width as string, if yes, use JS parseInt function.
If you are looking to stop animation syntax, see on http://api.jquery.com/stop/
It could be img_container.find('ul').stop();
This could help:
if(mess < (-1 * width)){
img_container.find('ul').stop();
}
-width?
if(mess <= 0 || mess < (width*-1) )