PDA

View Full Version : Div with scrollbars (Dynamic Scrollbar/ DHTML scrollbars)



proofke
04-05-2006, 08:42 AM
Hey,

i have this list
<dl>
....
<dt>title</dt>
<dd>data</dd>
....
</dl>

i want ot put a div with a scrollbar in a <dd></dd> like for third employees,
cuz sometimes the list is very long and i dont want a very huge page length.

iframe dont seem to work cuz i need a src="", and i also use ajax on this page.

<dl>
<dt>Creator</dt>
<dd>Brutyn Luc</dd>

<dt><label for="client_company_id">Client company</label></dt>
<dd>
<!-- For creating, we select the first value -->
<!-- When there is a validation error, we select the value from the paramater -->
<select id="client_company_id" name="client_company_id">
<option value="2" selected="selected">aaaa nv</option>
<option value="3">bbbb nv</option>
<option value="1">Twodecode NV/SA</option>
</select>
<span id="indicator1" style="display:none;">
<img alt="Spinner" src="/images/spinner.gif" /> Loading...
</span>
</dd>

<dt><label for="third_employee_list">Third employees</label></dt>
<dd>
<!-- For creating, we select the first value -->
<!-- When there is a validation error, we select the value from the paramater -->

=====>>>>> HERE I WANT A SCROLL BAR
<b>den test vb</b>:<br/>
<input type="checkbox" name="third_employee_list[]" id="third_employee_list" value="6" />ddddd dddd
<input type="checkbox" name="third_employee_list[]" id="third_employee_list" value="1" />den test wk 1 aaa
<input type="checkbox" name="third_employee_list[]" id="third_employee_list" value="3" />eeeee eeeee
<br/>
<input type="checkbox" name="third_employee_list[]" id="third_employee_list" value="4" />eeeee fffffff
<input type="checkbox" name="third_employee_list[]" id="third_employee_list" value="5" />ffffffff dddd
<br/>
<b>gggg gggg</b>:<br/>
<input type="checkbox" name="third_employee_list[]" id="third_employee_list" value="11" />ddd ddd
<br/>
<b>hhhhhhhhhhhhhh qs</b>:<br/>
<input type="checkbox" name="third_employee_list[]" id="third_employee_list" value="12" />hhhhhhh 111111
<input type="checkbox" name="third_employee_list[]" id="third_employee_list" value="13" />hhhhhhh 222222
<input type="checkbox" name="third_employee_list[]" id="third_employee_list" value="14" />hhhhhhh 333333
<br/>
<input type="checkbox" name="third_employee_list[]" id="third_employee_list" value="15" />hhhhhhh 444444
<br/>
<b>OCMW wzv</b>:<br/>
<input type="checkbox" name="third_employee_list[]" id="third_employee_list" value="16" />OWCM 111111
<input type="checkbox" name="third_employee_list[]" id="third_employee_list" value="17" />OWCM 22222
<input type="checkbox" name="third_employee_list[]" id="third_employee_list" value="18" />OWCM 33333
<br/>
<input type="checkbox" name="third_employee_list[]" id="third_employee_list" value="19" />OWCM 4444
<br/>
</dd>
</dl>

i saw something on http://www.dyn-web.com/dhtml/scroll/scroll-multi.html
but i cant get it to work :s:s

jscheuer1
04-06-2006, 04:49 AM
I'm not sure about those <dd> and <dl> tags but, all you need to do is put a division around your content. Set its dimensions and overflow:auto in its style:


<div style="width:300px;height:250px;overflow:auto;">

content goes here

</div>

Then if the content is too tall, there will be a vertical scrollbar. If the content is too wide and cannot wrap, there will be a horizontal scrollbar.

proofke
04-06-2006, 07:04 AM
thx it works