Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/05/2010, 19:53
Avatar de syslock64
syslock64
 
Fecha de Ingreso: septiembre-2009
Mensajes: 19
Antigüedad: 15 años, 4 meses
Puntos: 1
Pregunta Alinear Scrollbar="BOTTOM"

Buenas comunidad, tengo esta idea:

- Creando un "DIV" dentro de un "Div-Contenedor" con estilo Overflow="scrollbar", cuando voy creando los nuevos "DIV" 's ira agregando con appendChild al final del contendio como todos sabemos....

- Ahora cuando hay mucho k mostrar se activa el Scrollbar del DIV y los elementos creados se van creando uno abajo de otro... Hasta ahi todo OK

- Desearia saber como puedo posicionar el SCROLLBAR a lo mas bajo posible... k baje el scrollbar hasta la ultima posicion aki les dejo el codigo exacto... solo es un simple codigo pero para que puedan agregarle lo k le falta...

Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<script language="javascript" type="text/javascript">

function addElement(){
content="Contenido creado";
Elm_div = document.getElementById("content-chat");
ElmNew = document.createElement("div");
ElmNew.setAttribute("class","");
Elm_div.appendChild(ElmNew);

ElmNew.innerHTML=content;
ElmNew.onfocus;
}
</script>
</head>
<body onload="">
<div style="display:block; width:50px; height:10px; background:#blue; cursor:pointer" onclick="addElement()"></div>
<div id="content-chat" style="display:block; width:400px; height:100px; overflow:scroll">

</div>
</body>
</html> 
Desde ya muchas gracias a la comuna ^^