Renlok Posted December 15, 2007 Share Posted December 15, 2007 function addbadapple(){ var newbadapple = document.createElement('div'); var newid = 'badapple'+this.banum; newbadapple.setAttribute('id',newid); newbadapple.style.position = 'absolute'; var usethis = false; while(!usethis){ this.btop = this.correct[this.rannum(0,this.correct.length-1)]; this.bleft = this.correct[this.rannum(0,this.correct.length-1)]; if(this.numInArray(this.ctop,this.cleft,this.btop,this.bleft) == 0){ usethis = true; } } newbadapple.style.top = this.btop+"px"; //error with these two lines newbadapple.style.left = this.bleft+"px"; newbadapple.style.display = 'none'; newbadapple.style.backgroundColor = 'black'; newbadapple.style.height = '7px'; newbadapple.style.width = '7px'; newbadapple.style.overflow = 'hidden'; document.getElementById('board').appendChild(newbadapple); this.banum++; } its spoused to place a black 7 * 7 block on the page but nothing happens. i can figure out why Quote Link to comment Share on other sites More sharing options...
nogray Posted December 20, 2007 Share Posted December 20, 2007 what is "this" in your script? Quote Link to comment Share on other sites More sharing options...
php? Posted December 21, 2007 Share Posted December 21, 2007 Try placing the anabolic signature into the code reference to further exponentiate the constant value of "{;" and also add the list variable that corresponds to the IF statement. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 21, 2007 Share Posted December 21, 2007 you have several variables that are not declared - so the script does not know what they are - nor does anyone else. Quote Link to comment Share on other sites More sharing options...
Renlok Posted December 31, 2007 Author Share Posted December 31, 2007 this because its part of a class and some variables arn't set in this because i havn't included everything. But ive found the problem now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.