Ver Mensaje Individual
  #3 (permalink)  
Antiguo 11/06/2012, 06:51
quimfv
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Sabadell
Mensajes: 4.897
Antigüedad: 16 años, 1 mes
Puntos: 574
Respuesta: Evitar que un iframe obtenga foco

Oculta el iframe debajo de un div transparente.... pero claro luego nunca será accesible....


Código HTML:
Ver original
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <title>Documento sin t&iacute;tulo</title>
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  4. <style type="text/css">
  5. <!--
  6. #div1{
  7.    background: none;
  8.    position: absolute;
  9.    z-index: 1;
  10.    height: 300px;
  11.    width: 300px;
  12.    top: 0px;
  13. }
  14. #div2{
  15.    background: none;
  16.    position: absolute;
  17.    z-index: 0;
  18.    height: 300px;
  19.    width: 300px;
  20.    top: 0px;
  21. }
  22. -->
  23. </head>
  24. <div id="div1"><input name="" type="button" onClick="alert('Hola')" value="Click"></div>
  25. <div id="div2"><iframe src="http://www.forosdelweb.com/f13/evitar-que-iframe-obtenga-foco-997995/"></iframe></div>
  26. </body>
  27. </html>

Esta el vento onfocus pero parece que no funciona en todos los navegadores para iframe....
__________________
Quim
--------------------------------------------------
Ayudar a ayudar es una buena práctica!!! Y da buenos resultados.

Última edición por quimfv; 11/06/2012 a las 07:07