elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Sigue las noticias más importantes de seguridad informática en el Twitter! de elhacker.NET


+  Foro de elhacker.net
|-+  Programación
| |-+  Desarrollo Web (Moderador: #!drvy)
| | |-+  [Aporte] Menus Elasticos
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Aporte] Menus Elasticos  (Leído 1,684 veces)
AFelipeTrujillo

Desconectado Desconectado

Mensajes: 160



Ver Perfil WWW
[Aporte] Menus Elasticos
« en: 21 Junio 2010, 03:21 am »

Esta la forma de implementar un menu elástico:

Código
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3.  
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6.  
  7. <title>Menu Elastico</title>
  8.  
  9. <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js"></script>
  10. <!-- Llamamos a JQuery en uno de los repositorios de Google -->
  11. <script type="text/javascript">
  12. $(document).ready(function(){
  13. $('.menuitem img').animate({width: 100}, 0);
  14. $('.menuitem').mouseover(function(){
  15. gridimage = $(this).find('img');
  16. gridimage.stop().animate({width: 200}, 150);
  17. }).mouseout(function(){
  18. gridimage.stop().animate({width: 100}, 150);
  19. });
  20. });
  21. </script>
  22.  
  23. <style type="text/css">
  24. *{ padding:0px; margin:0px; }
  25. img{ border: none; -ms-interpolation-mode: bicubic; }
  26. body{ padding:10px; text-align:center; background:#fafafa; }
  27.  
  28. #wrapper{ position:absolute; left:20%; padding-top:100px; width:650px;}
  29.  
  30. #menuwrapper{ position:relative; height:210px;}
  31. #menu{position:absolute; bottom:0; left:0;}
  32. .menuitem{ position:fixed relative; bottom:0px; display:inline-block; }
  33.  
  34.  
  35. </style>
  36.  
  37. </head>
  38.  
  39. <div id="wrapper">
  40. <div id="menuwrapper">
  41. <div id="menu">
  42. <a href="icons.jpg" class="menuitem"><img src="icons.jpg"></a>
  43. <a href="neattext.jpg" class="menuitem"><img src="neattext.jpg"></a>
  44. <a href="officeal.jpg" class="menuitem"><img src="officeal.jpg"></a>
  45. <a href="curtain.jpg" class="menuitem"><img src="curtain.jpg"></a>
  46. <a href="rebrand.jpg" class="menuitem"><img src="rebrand.jpg"></a>
  47. </div>
  48. </div>
  49.  
  50. </div>
  51.  
  52. </body>
  53. </html>

Ejemplo

FUENTE 1

FUENTE 2


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines