how to set <div> scrollbar to top

How to set <div> scrollbar to top

Page 1 of 1

3 Replies - 15826 Views - Last Post: 26 February 2009 - 09:58 PM

#1 sutr_kam  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 15-February 09

how to set <div> scrollbar to top

Posted 26 February 2009 - 05:58 AM

I have a <div> tag with overflow:auto
option
and the data is high and there is scrolling for the div tag.

I need to set the scroll to top,
Is this possible?
how can we set this one.


thanks & regards,
sutr kam
Is This A Good Question/Topic? 0
  • +

Replies To: how to set <div> scrollbar to top

#2 jjsaw5  Icon User is offline

  • I must break you
  • member icon

Reputation: 90
  • View blog
  • Posts: 3,060
  • Joined: 04-January 08

Re: how to set <div> scrollbar to top

Posted 26 February 2009 - 07:13 AM

Can you please provide your code.
Was This Post Helpful? 0
  • +
  • -

#3 gregwhitworth  Icon User is offline

  • Tired.
  • member icon

Reputation: 219
  • View blog
  • Posts: 1,604
  • Joined: 20-January 09

Re: how to set <div> scrollbar to top

Posted 26 February 2009 - 08:46 AM

First off supply your code, second do you mean that you want the scroll bar to start off at the top, or have a 'back to top' button?

--

Greg
Was This Post Helpful? 0
  • +
  • -

#4 sutr_kam  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 15-February 09

Re: how to set <div> scrollbar to top

Posted 26 February 2009 - 09:58 PM

<div id="outerDIV" style="visibility:hidden;">
			<div id="multiDropDown" style="border: 1px solid;overflow: auto;position: absolute; 
						height: 100px; width: 200px;color: SteelBlue; background: #FFFFFF none repeat scroll 0% 0%;">
				<table border="0" cellpadding="0" cellspacing="0" id="multiDropDown_dropListTable" 
						style="border-top: none; color: black; font-size: 11pt; width: 100%;">
					<tr >
						<td width="100%">Hello World</td>
					</tr>
					<tr >
						<td width="100%">--------------------</td>
					</tr>
					<tr >
						<td width="100%" id="td_1" name="td_1"><input type="checkbox" name="checkbox_1" onclick='onclick(1)'>Checkbox1</td>
					</tr>
					<tr id='tr_2' name='tr_2' >
						<td width="100%" id="td_2" name="td_2"><input type="checkbox" name="checkbox_2" onclick='onclick(2)'>Checkbox2</td>
					</tr>
					<tr id='tr_3' name='tr_3' >
						<td width="100%" id="td_3" name="td_3"><input type="checkbox" name="checkbox_3" >Checkbox3</td>
					</tr>
					<tr id='tr_4' name='tr_4' >
						<td width="100%" id="td_4" name="td_4"><input type="checkbox" name="checkbox_4" onclick='onclick(4)'>Checkbox4</td>
					</tr>
					<tr id='tr_5' name='tr_5' >
						<td width="100%" id="td_5" name="td_5"><input type="checkbox" name="checkbox_5" onclick='onclick(5)'>Checkbox5</td>
					</tr>
					<tr id='tr_6' name='tr_6' >
						<td width="100%" id="td_6" name="td_6"><input type="checkbox" name="checkbox_6" onclick='onclick(6)'>Checkbox6</td>
					</tr>
					<tr >
						<td width="100%">--------------------</td>
					</tr>
					<tr >
						<td width="100%">Hello World...</td>
					</tr>
				</table>
			</div>



simple iam hiding and showing the div on some particular action
whenever iam hiding the <div> the scroll bar need to set to top
so that whenever iam showing the div always the scroll bar to be top

Yes Iam clicking some image to show/hide this <div>
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1