Click here to Skip to main content
15,881,872 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello,

I have a simple connect4 game, and I compose all slots putting images in an HTML table witch actions associated

....
<td><a href='javascript:void colocarPeca(0)' onMouseOver='colocarPecaAux(0); return true' onMouseOut='anularJogada(0)'><img border='0' src='imagens/vazia.png' height='75' width='75'></a></td>
....


And I update every image after every move.

The problem, I'm having some problems using images. I want to "migrate" every image to CSS/JS objects. Is it possible?

What I need it's objects/elements that look like this:

http://oi53.tinypic.com/28vwz60.jpg

and put all that in a table with onclick actions.

Cant use jQuery Flash.

I believe I can achieve starting with the square

C#
function drawRectangle(left, top, width, height) {
 if (document.createElement) {
   newdiv=document.createElement("div");
   newdiv.style.position="absolute";
   newdiv.style.left = left+"px";
   newdiv.style.top  = top+"px";
   newdiv.style.width = width+"px";
   newdiv.style.height = height+"px";
   newdiv.style.backgroundColor = 'blue';
   newdiv.style.visibility = 'visible';
   newdiv.id = 'newdiv';
   newdiv.innerHTML = "real";
   document.body.appendChild(newdiv);
   }
 }


However I have no idea how to put that circle in it.

I'm sorry for this question, I'm really not into design, what's why I was (badly) using images.
Posted
Updated 27-Mar-11 11:59am
v3
Comments
Maxdd 7 27-Mar-11 11:54am    
Anyone?
Manfred Rudolf Bihy 27-Mar-11 17:57pm    
Kind of a strange requirement: "Can't use jQuery ...".
Can you explain why jQuery is not an option?
Maxdd 7 27-Mar-11 17:58pm    
With would be easier? I'm editing my question now, open to all kind of suggestions :)

1 solution

You could insert another DIV into your first with your "coin"'s background colour, and you can set the "round corners" on the DIV to make it look like a circle

You'll want CSS styles like this
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900