Search Results

Search found 2 results on 1 pages for 'joeozz'.

Page 1/1 | 1 

  • Trying to create an infinite for loop that can stop using function doIt()

    - by JoeOzz
    Hey guys, I'm new to javascript and I'm doing a project for my final in class. I need to make it so this game engine I manipulated causes the generation button to go for an infinite loop. I also need to stop it using (Reset==1). Any help? Here's the code I have so far if that helps: function generation() { for(y2=0; y2<2500; y2++) { tempmapactual[y2]=mapactual[y2]; } for (g=0;g<2500;g++) { neighbours=0; for (h=0;h<8;h++) { if (g+coords[h]>0 && g+coords[h]<2499 && mapactual[g+coords[h]]=="white.gif") {neighbours=neighbours+1;} } if (neighbours>=4 || neighbours==1 || neighbours==0) {tempmapactual[g]="black.gif";} if (neighbours==3) {tempmapactual[g]="white.gif";} } for(y3=0; y3<2500; ++y3) { if (mapactual[y3]!=tempmapactual[y3]) { mapactual[y3]=tempmapactual[y3]; document.images[y3+offset].src=mapactual[y3]; } } } </script> <script> function doIt() { for (i=0; i<X; i++) { // This is where I have trouble. What part of generation() do I call? } if (Reset==1) break; // This will kill the loop instantly. } } </script> <script> window.onload(doIt($(X).value))); </script> <form> <input type="button" value="generate" onClick="generation();"> </form> <form> <input type="text"> </form> <form> <input type="button" value="Infinite Loop!" onclick="doIt();"> </form> <form> <input type="button" value="Reset" onclick="doIt();"> </form>

    Read the article

  • Trying to get simple jquery animations on a site I created in Dreamweaver

    - by JoeOzz
    Hey guys, another question. I'm trying to do some basic jQuery stuff for my final project. I'll be using it to modify my already existing site created in Dreamweaver a few months ago. However, no matter how I source the framework, it just won't take regardless of whether I host my own copy or link to someone else's like Google's. I'm including my jQuery function calls within my already existing .js file that includes some auto generated functions. I also tried creating a new .js specifically for my jQuery functions and still nothing. I realize this is vague, but any tips? Do I need another framework for jQuery to work off of to make animations like .fadeIn() or .slideDown()? Thanks guys and gals!

    Read the article

1