Ver Mensaje Individual
  #5 (permalink)  
Antiguo 19/03/2013, 19:50
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Boton animado

Según lo veo te está complicando, hacé un sprite de 2 imágenes por botón y utilizá el pseudoatributo hover de css

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2.    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Efecto hover css</title>
  6. <style type="text/css">
  7. /*<![CDATA[*/
  8.  
  9. a#uno{
  10. width: 100px;
  11. height: 25px;
  12. background-position: center top;
  13. background-image: url('boton_uno.jpg');
  14. border: none;
  15. display:block;
  16. }
  17. a#uno:hover{
  18. background-position: center -25px;
  19. }
  20.  
  21. a#dos{
  22. width: 100px;
  23. height: 25px;
  24. background-position: center top;
  25. background-image: url('boton_dos.jpg');
  26. border: none;
  27. display:block;
  28. }
  29.  
  30. a#dos:hover{
  31. background-position: center -25px;
  32. }
  33.  
  34. a{
  35. margin: 3px;
  36. }
  37. /*]]>*/
  38. </head>
  39. <a href="uno.html" id="uno"><!-- fix --></a>
  40. <a href="dos.html"  id="dos"><!-- fix --></a>
  41. </body>
  42. </html>

Demo
http://foros.emprear.com/css/over_in...lover-css.html

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.