how to dynamically exit a jquery $.each()?
问题 i have a list of images which i am getting through ajax and then using jquery $.each() i loop through the images and display a image one after the other after an interval of one second. I want the user to be able click on a stop button and so that the user can stop at a particular image if he wants to. So i need to dynamically exit $.each() when the user clicks on the stop button. Is it possible to do it? 回答1: You can use return false to break out of each() loops early. Example: <script> $(