Help needed: I want to implement a scroll feature for the parent div but here's the catch - the width of the text inside the div needs to be in percentage. So, if there is a long name, it should scroll within the parent div.
HTML:
<div id="list">
<div class="info">
<div class="image">
<img src="https://dl.dropbox.com/u/14396564/no_camera.jpg"> </div>
<div class="text_data">Intell. off. ch. 1 with a very very very long</div>
</div>
<div class="info">
<div class="image">
<img src="https://dl.dropbox.com/u/14396564/no_camera.jpg">
</div>
<div class="text_data">Intell. off.</div>
</div>
</div>
CSS:
#list{
max-height:200px;
overflow-y:auto;
padding:5px;
/*display: none;*/
}
.info{
border: 1px dashed #CCCCCC;
margin-bottom: 5px;
padding:5px;
overflow: hidden;
cursor: pointer;
}
.info .image{
width:20%;
display:inline-block;
margin-right:20px;
/*border: 1px solid red;*/
}
.info .image img{
width: 100%;
}
.info .text_data{
display: inline-block;
/*border: 1px solid green;*/
vertical-align: top;
overflow-x: auto !important;
}