Ver Mensaje Individual
  #7 (permalink)  
Antiguo 07/05/2011, 20:30
angelfcm
(Desactivado)
 
Fecha de Ingreso: abril-2011
Mensajes: 153
Antigüedad: 13 años
Puntos: 236
Respuesta: Varios Problemas

Orale ya me toco que me pase eso, hehe.
Se corta el div cuándo el contenido no cabe, y supongo que cuándo no quepa el contenido, quieres que aparesca el scroll y cuándo llegues hasta abajo no se corte el div (que aparesca blanco).
Pues ahora sí que sí de afuerzas de tiene que funcionar, prueba éste ejemplo, que en mi opinión es el definitivo para el problema 1:
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml/DTD/xhtml1-transitional.dtd">
  3. <!-- PROBADO EN IE9 Y MOZILLA 4 -->
  4. <title>Pantalla completa - ContentBox2</title>
  5. <script type="text/javascript">
  6. window.onscroll = medidaDIV;
  7. window.onresize = medidaDIV;
  8. window.onload = medidaDIV;
  9. function medidaDIV()
  10. {
  11.  if(document.documentElement.scrollTop==0)
  12.   y=document.documentElement.clientHeight+"px";
  13.  else{
  14.    if(document.defaultView)
  15.      y=document.defaultView.getComputedStyle(document.getElementById("denominador"),null).top;
  16.    else y=document.getElementById("denominador").currentStyle.top;
  17.  }
  18.  document.getElementById("ContentBox").style.height=y;//;document.documentElement.clientHeight+"px";
  19. }
  20. <style type="text/css">
  21. /* No agregar tamaño al padding-top/bottom ni al margin-top/bottom en #ContentBox, body o html */
  22. html,body{
  23.     background-color: #F4F4F4;
  24.     color: #333333;
  25.         font-family: "lucida grande",tahoma,verdana,arial,sans-serif;
  26.         font-size: 11px;
  27.         margin: 0;
  28.     padding: 0;
  29. }
  30. #ContentBox {position:absolute;
  31.     width: 870px;
  32.     background-color: #DBECFD;
  33. }
  34. #ContentBox2 {
  35.     padding: 95px 15px 5px 15px;
  36. }
  37. </head>
  38. <!-- no borrar ContentBox ní ContentBox2 ní poner nada fuera de ellos a menos que sea con display:none -->
  39. <div id="ContentBox">
  40. <div id="ContentBox2">
  41.  <h1>AQUÍ EL CONTENIDO DE LA PÁGINA</h1><h1>AQUÍ EL CONTENIDO DE LA PÁGINA</h1>
  42.  <h1>AQUÍ EL CONTENIDO DE LA PÁGINA</h1><h1>AQUÍ EL CONTENIDO DE LA PÁGINA</h1>
  43. </div>
  44. <!-- no borrar denominador ní modificarlo -->
  45. <span style="position:absolute" id="denominador" style="display:none"></span>
  46. </div>
  47. </body>
  48. </html>

Última edición por angelfcm; 07/05/2011 a las 22:37