Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/12/2010, 04:32
Avatar de neodani
neodani
 
Fecha de Ingreso: marzo-2007
Mensajes: 1.811
Antigüedad: 17 años, 2 meses
Puntos: 20
Pulsar fuera y cerrar el menu

Buenas,

Tengo un problema con este script he conseguido que funcione casi como quiero, pulsas sobre la bandera y te muestra un menu escondido para que marques otro idioma, sin embargo solo se cierra cuando se vuelve a pulsar sobre la bandera.

Se puede hacer que también se cierre si se pulsa fuera, en cualquier otro lugar de la página?

Código HTML:
Ver original
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xml:lang="es" xmlns="http://www.w3.org/1999/xhtml" lang="es"><head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  4. <meta http-equiv="Content-Language" content="es">
  5. <link rel="stylesheet" type="text/css" href="reset-fonts-grids.css">
  6. <link rel="stylesheet" type="text/css" href="common.css">
  7. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  8.      <script language="javascript">
  9.      $(document).ready(function() {
  10.           $('#menutoggle').click(function() {
  11.                if ($('#lngMenu').is(":hidden"))
  12.                {
  13.                     $('#lngMenu').fadeIn('fast');
  14.                } else {
  15.                     $('#lngMenu').fadeOut('fast');
  16.                }
  17.                return false;
  18.           });
  19.      });
  20.      </script>
  21. </head>
  22. <img id="menutoggle" src="es.gif" alt="Language" height="11" width="16">
  23. <ul style="-moz-user-select: none; display: none; top: 63px; left: 656.5px;" id="lngMenu" class="contextMenu">
  24.   <li class=""><a href="http://www.mindomo.com/login.htm?lang=en">English</a></li>
  25.   <li><a href="http://www.mindomo.com/login.htm?lang=de">Deutsch</a></li>
  26.   <li><a href="http://www.mindomo.com/login.htm?lang=es">Español</a></li>
  27.   <li><a href="http://www.mindomo.com/login.htm?lang=fr">Français</a></li>
  28.   <li><a href="http://www.mindomo.com/login.htm?lang=it">Italiano</a></li>
  29.   <li><a href="http://www.mindomo.com/login.htm?lang=se">Svenska</a></li>
  30. </ul>
  31. </body>
  32. </html>

Muchas gracias de antemano!