javascript - How to end my for loop? -


I have to end the loop in javascript .. the obvious answer is while loop-- although I'm not sure how to implement it Here, I tried to put it in front of the loop (while (stop == wrong)), but then it remains forever ...

This code is used in every 1 Millisecond At the moment, even if the stop == true goes through the rest of the part .. How can I do that if stop == is true, then do not look for them < Code> & lt; Script & gt; {var ("#" + i) for (var i = 1; i & lt; = gDivCount; i ++) Position (). Top, $ ("#" + i). Position (). left]; var toprightofgdiv = [$ ("#" + i). composition (). Top, $ ("#" + i). Business () Left + $ ("#" + i) With ()]; If (topleftofgdiv [0]> scales [0]) {var stop = false; Console.log (wrong); } And {var stop = true; Console.log (true); } If (stop == incorrect) {var pandanewpos = $ ("# moveDiv"). Event (). Top + 3; Document.getElementById ("moveDiv"). Style.top = PendionWopps + "Pix"; }} & lt; / Script & gt;

Use:

  if (stop) { break; }   

For simplicity, you can use your existing if statement:

  if (stop == false ) {Var pandanewpos ...} and {break; }    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -