Jump to content

[SOLVED] whats wrong with this?


Renlok

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/81852-solved-whats-wrong-with-this/
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.