Ver Mensaje Individual
  #5 (permalink)  
Antiguo 05/07/2014, 18:56
alvaro0022
 
Fecha de Ingreso: octubre-2009
Ubicación: Santa Fe
Mensajes: 206
Antigüedad: 14 años, 6 meses
Puntos: 7
Respuesta: Mostrar contenido segun parametro

Clarooo!!!

Funciona de maravillas!!!!

Muchísimas gracias Alexis88, eres un genio!!!

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 xmlns="http://www.w3.org/1999/xhtml">
  3. </head>
  4.         <img src = "imagen1024x768.jpg" id = "ejemplo" />
  5.         <div id="texto1" style="display:none;">CONTENIDO A OCULTAR/MOSTRAR</div>
  6.         <div id="texto2" style="display:none;">ddddddddd</div>
  7.         <script language="Javascript">
  8. function foo(id){
  9.     var imagen = document.getElementById(id),
  10.         ancho = imagen.offsetWidth,
  11.         alto = imagen.offsetHeight;
  12.    
  13.     if (ancho == 1024 && alto == 768){
  14.     div = document.getElementById('texto1');
  15.     div.style.display = 'block';
  16.     }
  17.     else if (ancho == 1920 && alto == 1080){
  18.     div = document.getElementById('texto2');
  19.     div.style.display = 'block';
  20.     }
  21.     else{ //Otras medidas
  22.         //Instrucciones
  23.     }
  24. }
  25.  
  26. foo("ejemplo");
  27. </script>
  28. </body>
  29. </html>

Aquí el código completo por si alguien quiere usarlo.

saludos!!
__________________
Fondos de pantalla
Juegos Gratis