Foros del Web » Creando para Internet » CSS »

animacion con css3 y javascripts

Estas en el tema de animacion con css3 y javascripts en el foro de CSS en Foros del Web. Buenos días, estoy intentando hacer un menú con circulos y con animacion css3, mi problema es el siguiente, cuando pulso sobre el circulo principal me ...
  #1 (permalink)  
Antiguo 05/10/2012, 02:24
 
Fecha de Ingreso: febrero-2007
Mensajes: 62
Antigüedad: 17 años, 2 meses
Puntos: 1
Pregunta animacion con css3 y javascripts

Buenos días, estoy intentando hacer un menú con circulos y con animacion css3, mi problema es el siguiente, cuando pulso sobre el circulo principal me aparecen los cuatro subcirculos con su animacion, el problema es cuando vuelvo a pulsar me desaparecen derrepente, y nose como tengo que hacer para que desaparezca con animacion, os dejo el código.

Código HTML:
Ver original
  1. <!doctype html>
  2. <meta charset="utf-8">
  3. <title>Documento sin título</title>
  4. <script language="javascript">
  5. function mostrar_ocultar(){
  6.     var mostrar=document.getElementById("muestra");
  7.     if(mostrar.style.display=="none"){
  8.         mostrar.style.display="block"; 
  9.     }else{
  10.         mostrar.style.display="none";
  11.  
  12.    
  13.    
  14.     }
  15. }
  16.  
  17.  
  18. <link href="prueba_css.css" rel="stylesheet" type="text/css">
  19. </head>
  20.  
  21. <div id="contenedor">
  22.   <header>
  23.   </header>
  24.   <article>
  25.     <ul>
  26.      
  27.       <span class="capa5"><h1 style="font-size:32px;line-height:150px">
  28.       <a href="#" onClick="mostrar_ocultar()">CV Isabel</a>
  29.       </h1></span>
  30.      
  31.       <div id="muestra">
  32.         <li class="size_letra capa4">Datos personales</li>
  33.         <li class="capa3">Formación</li>
  34.         <li class="capa2" style="font-size:120%;line-height:125px;">Experiencia</li>
  35.         <li class="capa1">Contacto</li>
  36.       </div>
  37.     </ul>
  38.   </article>
  39.   <footer>
  40.   </footer>
  41. </div>
  42. </body>
  43. </html>

el css

Código HTML:
ul {
	padding: 0;
	margin: 0;
	list-style: none;
}
li {

	width: 200px;
	height: 200px;
	border-radius: 50%;
	border: 1px solid rgba(0,0,0,1);
	font-size: 150%;
	text-align: center;
	line-height: 500%;
	font-family: grutchShaded;
	position: absolute;
	left: 50%;
	top: 50%;
	margin-left: -100px;
	margin-top: -100px;
	background-color: rgba(0,0,0,1);
	box-shadow: inset 0px 0px 10px 3px rgba(153,153,153,1);
	color: #CCC;
}
li.capa1 {
	-webkit-animation-duration: 1.5s;
	-webkit-animation-name: circulos1;
}
li.capa2 {
	-webkit-animation-duration: 1.5s;
	-webkit-animation-name: circulos2;
}
li.capa3 {
	-webkit-animation-duration: 1.5s;
	-webkit-animation-name: circulos3;
}
li.capa4 {
	-webkit-animation-duration: 1.5s;
	-webkit-animation-name: circulos4;
}
#muestra {
	display: none;
}

#contenedor {
	height: 700px;
	width: 90%;
	margin-right: auto;
	margin-left: auto;
	margin-top: 3%;
}
span {

	width: 200px;
	height: 201px;
	border-radius: 50%;
	border: 1px solid rgba(0,0,0,1);
	font-size: 32px;
	text-align: center;
	line-height: 200px;
	font-family: grutchShaded;
	position: absolute;
	left: 50%;
	top: 50%;
	margin-left: -100px;
	margin-top: -100px;
	background-color: rgba(199,199,203,1);
	box-shadow: inset 0px 0px 10px 3px rgba(153,153,153,1);
}
span a {
	color: rgba(0,0,0,1);
	text-decoration: none;
}
li:hover {
	color: #000;
	background-color: #CCC;
}
.size_letra {
	font-size: 150%;
	line-height: 200%;
}
.capa5 {
	z-index: 5;
}
.capa4 {
	z-index: 4;
	left: 40%;
	top: 35%;
}
.capa3 {
	z-index: 3;
	left: 65%;
	top: 35%;
}
.capa2 {
	z-index: 2;
	left: 40%;
	top: 75%;
}
.capa1 {
	z-index: 1;
	left: 65%;
	top: 75%;
}
@-webkit-keyframes cabecera {
	 0% {
		 width: 200px;
		 height: 201px;
		 border-radius: 50%;
		 border: 1px solid rgba(0,0,0,1);
		 font-size: 32px;
		 text-align: center;
		 line-height: 200px;
		 font-family: grutchShaded;
		 position: absolute;
		 left: 50%;
		 top: 50%;
		 margin-left: -100px;
		 margin-top: -100px;
		 background-color: rgba(199,199,203,1);
		 box-shadow: inset 0px 0px 10px 3px rgba(153,153,153,1);
		 z-index:5;
	}
	 100% {
		 width:100%;
		 height:50px;
		 top:100px;
		 left:10px;
		 border-radius:0px;
		 text-align:center;
		 margin-left:auto;
		 margin-right:auto;
	}
}
 @-webkit-keyframes circulos4 {
	 0% {
		 left:50%;
		 top:50%;
	}
	 100% {
		left: 40%;
		top: 35%;
	}
}
@-webkit-keyframes circulos3 {
	 0% {
		 left:50%;
		 top:50%;
	}
	 100% {
		left: 65%;
		top: 35%;
	}
}
@-webkit-keyframes circulos2 {
	 0% {
		 left:50%;
		 top:50%;
	}
	 100% {
		left:40%;
		top:75%;
	}
}
@-webkit-keyframes circulos1 {
	 0% {
		 left:50%;
		 top:50%;
	}
	 100% {
		left:65%;
		top:75%;
	}
}

@-webkit-keyframes descirculos1 {
	 0% {
		 left:50%;
		 top:50%;
	}
	 100% {
		left:65%;
		top:75%;
	}
}

Etiquetas: animacion, css3, hover, html, javascript, fondo
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 13:38.