Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/03/2014, 04:21
KatonSP
 
Fecha de Ingreso: abril-2009
Mensajes: 63
Antigüedad: 15 años
Puntos: 0
Redimensionar div automaticamente

Buenas, estoy desarrollando un slide de imagenes horizontal y el problema que tengo es que no se como podría hacer dinámico el width del segundo div, actualmente lo tengo puesto a 2000 pixeles y al final le sobra un poco y en otros casos tengo varias imagenes y si se queda corto por lo que realiza un salto de línea.

Este es el código:

Código HTML:
<div style="width:300px; background-color:white; height:180px; overflow:auto;">
    <div style="width: 2000px; height: 180px;background-color:silver">
        <image width="auto" height="170px" src="https://lh6.ggpht.com/DTkTSeycCBedLKFEDdFf3n_uPxz2uv3JeZPj7Vzd5imFRIYBrtUNUQ8HRJaeY9L6JeB5=h310"/>
        <image width="auto" height="170px" src="https://lh6.ggpht.com/DTkTSeycCBedLKFEDdFf3n_uPxz2uv3JeZPj7Vzd5imFRIYBrtUNUQ8HRJaeY9L6JeB5=h310"/>
        <image width="auto" height="170px" src="https://lh6.ggpht.com/DTkTSeycCBedLKFEDdFf3n_uPxz2uv3JeZPj7Vzd5imFRIYBrtUNUQ8HRJaeY9L6JeB5=h310"/>
        <image width="auto" height="170px" src="https://lh6.ggpht.com/DTkTSeycCBedLKFEDdFf3n_uPxz2uv3JeZPj7Vzd5imFRIYBrtUNUQ8HRJaeY9L6JeB5=h310"/>
        <image width="auto" height="170px" src="https://lh6.ggpht.com/DTkTSeycCBedLKFEDdFf3n_uPxz2uv3JeZPj7Vzd5imFRIYBrtUNUQ8HRJaeY9L6JeB5=h310"/>
        <image width="auto" height="170px" src="https://lh6.ggpht.com/DTkTSeycCBedLKFEDdFf3n_uPxz2uv3JeZPj7Vzd5imFRIYBrtUNUQ8HRJaeY9L6JeB5=h310"/>
        <image width="auto" height="170px" src="https://lh6.ggpht.com/DTkTSeycCBedLKFEDdFf3n_uPxz2uv3JeZPj7Vzd5imFRIYBrtUNUQ8HRJaeY9L6JeB5=h310"/>
        <image width="auto" height="170px" src="https://lh6.ggpht.com/DTkTSeycCBedLKFEDdFf3n_uPxz2uv3JeZPj7Vzd5imFRIYBrtUNUQ8HRJaeY9L6JeB5=h310"/>
    </div>
</div> 
¿Hay alguna manera de que el width del segundo div sea dinamico?

Saludos