Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/03/2011, 08:19
lktmaster
 
Fecha de Ingreso: enero-2011
Ubicación: Barcelona
Mensajes: 79
Antigüedad: 13 años, 10 meses
Puntos: 1
Respuesta: type="button" que sea enter

Hos dejo aqui todo el codigo de la calculadora, haver si hos sirve.

ya funciona en todos los navegadores aunque el :active no me funciona en firefox no se si és normal.

aparte de eso solo falta el "=" en el enter y ya estaria.

Código HTML:
<html><head>
</head>
<style type="text/css">
#box {
  margin: 40px auto;
  width:196;
  height:248;
  color: inherit;
  background: url("images/fondo.png");background-repeat: no-repeat; position:relative;}
img { border:0; }

.in {background:url(images/num.png); background-repeat: no-repeat;width: 127px; height: 40px;}


.zero   {background:url(images/tot.png)0 -720px; top:191.667px; left:56.333px;}
.uno 	{background:url(images/tot.png)0 -675px; top:57.668px; left:13px;}
.dos 	{background:url(images/tot.png)0 -630px; top:57.668px; left:56.333px;}
.tres 	{background:url(images/tot.png)0 -585px; top:57.668px; left:99.666px;}
.cuatro {background:url(images/tot.png)0 -540px; top:102.334px; left: 13px;}
.cinco  {background:url(images/tot.png)0 -495px; top:102.334px; left:56.333px;}
.seis   {background:url(images/tot.png)0 -450px; top:102.334px; left:99.666px;}
.siete  {background:url(images/tot.png)0 -405px; top:147px;     left:13px;}
.ocho   {background:url(images/tot.png)0 -360px; top:147px;     left:56.333px;}
.nueve  {background:url(images/tot.png)0 -315px; top:147px;     left:99.666px;}
.logo   {background:url(images/tot.png)0 0px;    top:13.002px;  left:142.999;}
.por    {background:url(images/tot.png)0 -45px;  top:147px;     left:142.999px;}
.dividir{background:url(images/tot.png)0 -90px;  top:191.667px; left:142.999px;}
.mas    {background:url(images/tot.png)0 -135px; top:57.668px;  left:142.999px;}
.menos  {background:url(images/tot.png)0 -180px; top:102.334px; left:142.999px;}
.c      {background:url(images/tot.png)0 -270px; top:191.667px; left:13px;}
.igual  {background:url(images/tot.png)0 -225px; top:191.667px; left:99.666px;}

.zero:active    {background:url(images/tot.png)-60px -720px; top:191.667px; left:56.333px;}
.uno:active     {background:url(images/tot.png)-60px -675px; top:57.668px; left:13px;}
.dos:active     {background:url(images/tot.png)-60px -630px; top:57.668px; left:56.333px;}
.tres:active    {background:url(images/tot.png)-60px -585px; top:57.668px; left:99.666px;}
.cuatro:active  {background:url(images/tot.png)-60px -540px; top:102.334px; left: 13px;}
.cinco:active   {background:url(images/tot.png)-60px -495px; top:102.334px; left:56.333px;}
.seis:active    {background:url(images/tot.png)-60px -450px; top:102.334px; left:99.666px;}
.siete:active   {background:url(images/tot.png)-60px -405px; top:147px;     left:13px;}
.ocho:active    {background:url(images/tot.png)-60px -360px; top:147px;     left:56.333px;}
.nueve:active   {background:url(images/tot.png)-60px -315px; top:147px;     left:99.666px;}
.logo:active    {background:url(images/tot.png)-60px 0px;    top:13.002px;  left:142.999;}
.por:active     {background:url(images/tot.png)-60px -45px;  top:147px;     left:142.999px;}
.dividir:active {background:url(images/tot.png)-60px -90px;  top:191.667px; left:142.999px;}
.mas:active     {background:url(images/tot.png)-60px -135px; top:57.668px;  left:142.999px;}
.menos:active   {background:url(images/tot.png)-60px -180px; top:102.334px; left:142.999px;}
.c:active       {background:url(images/tot.png)-60px -270px; top:191.667px; left:13px;}
.igual:active   {background:url(images/tot.png)-60px -225px; top:191.667px; left:99.666px;}

.zero,
.uno,
.dos,
.tres,
.cuatro,
.cinco,
.seis,
.siete,
.ocho,
.nueve,
.logo,
.por,
.dividir,
.mas,
.menos,
.c,
.igual {background-repeat: no-repeat;	width: 40px; height: 40px;position: absolute;}

</style>

<body>

<div id="box">

<form name="Calc">
<input class="in" name="Input" type="text" style="font-family: arial; font-size: 15pt; text-align: left; position: absolute; top: 13.002px; left: 13px;">

<a class="logo"  href="http://www.vicensvivesdigital.com" style="position: absolute; top: 13.002px; left: 142.999;"></a>
   
<a class="uno" name="one" value="  1  " onclick="Calc.Input.value += '1'" type="button"></a>
<a class="dos" name="two" value="  2  " onclick="Calc.Input.value += '2'" type="button"></a>
<a class="tres" name="three" value="  3  " onclick="Calc.Input.value += '3'" type="button"></a>
<a class="mas" name="plus" value="  +  " onclick="Calc.Input.value += '+'" type="button"></a>

<a class="cuatro" name="four" value="  4  " onclick="Calc.Input.value += '4'" type="button"></a>
<a class="cinco" name="five" value="  5  " onclick="Calc.Input.value += '5'" type="button"></a>
<a class="seis" name="six" value="  6  " onclick="Calc.Input.value += '6'" type="button"></a>
<a class="menos" name="minus" value="  -  " onclick="Calc.Input.value += '-'" type="button"></a>
 
<a class="siete" name="seven" value="  7  " onclick="Calc.Input.value += '7'" type="button"></a>
<a class="ocho" name="eight" value="  8  " onclick="Calc.Input.value += '8'" type="button"></a>
<a class="nueve" name="nine" value="  9  " onclick="Calc.Input.value += '9'" type="button"></a>
<a class="por" name="times" value="  x  " onclick="Calc.Input.value += '*'" type="button"></a>
 
<a class="c" name="clear" value="  c  " onclick="Calc.Input.value = ''" type="button"></a>
<a class="zero" name="zero" value="  0  " onclick="Calc.Input.value += '0'" type="button"></a>
<a class="igual" name="DoIt" value="  =  " onclick="Calc.Input.value = eval(Calc.Input.value)"></a>
<a class="dividir" name="div" value="  /  " onclick="Calc.Input.value += ' / '" type="button"></a>

</form>

</div>


</body></html>