By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,206 Members | 998 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,206 IT Pros & Developers. It's quick & easy.

Setting Scrollable position for div tag

P: n/a
Hi,
I'm having a jsp page which is having a table and a div tag.The
heading such as a radio button,Name , Age etc. are fixed.Only the data
under it is scrolling. So i've set one table for header which are
fixed.
Then a div tag inside which there is a table which is used for
scrolling the data.When i select a radio i'm submitting the form.The
problem is here i'm able to set focus to the radio button, but i'm
unable to maintain the scrolling position, when i scrolled downeards.I
want the same scrolling position as it was before submitting the form.

Code is something like this
<body topmargin=0 leftmargin=0
onLoad='javascript:fContractScrollTo("<%=hidScroll %>");'>
<html:form action="wspr/loadContract.go">
<table >
<tr>
<td>radio button</td>
<td> Name </td>
<td> Age </td>
</tr>
</table>
<div id="divContractID"
style="height:175;width:460;background:white;overf low:auto;">
<table>
<logic:iterate id="Contract" name="CONTRACTLIST">
<bean:define id="ContractVO" name="Contract" type="ContractVO" />
<tr>
<td>radio</td>
<td>Name</td>
<td>Age</td>
</tr>
</logic:iterate>
</table>
</div>
</html:form>
</body>
Javascript function like this
function fContractScrollTo('val') {
window.scrollTo(0,document.getElementById('divCont ractID').scrollTop);
}

Is it possible to set the maintain the scrollable position in a div
tag.
Thanx in Advance
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Not really. But I would use anchors to scroll with in any event (no script
required.)

"Muralidhar" <km********@yahoo.com> wrote in message
news:ac**************************@posting.google.c om...
| Hi,
| I'm having a jsp page which is having a table and a div tag.The
| heading such as a radio button,Name , Age etc. are fixed.Only the data
| under it is scrolling. So i've set one table for header which are
| fixed.
| Then a div tag inside which there is a table which is used for
| scrolling the data.When i select a radio i'm submitting the form.The
| problem is here i'm able to set focus to the radio button, but i'm
| unable to maintain the scrolling position, when i scrolled downeards.I
| want the same scrolling position as it was before submitting the form.
|
| Code is something like this
|
|
| <body topmargin=0 leftmargin=0
| onLoad='javascript:fContractScrollTo("<%=hidScroll %>");'>
| <html:form action="wspr/loadContract.go">
| <table >
| <tr>
| <td>radio button</td>
| <td> Name </td>
| <td> Age </td>
| </tr>
| </table>
| <div id="divContractID"
| style="height:175;width:460;background:white;overf low:auto;">
| <table>
| <logic:iterate id="Contract" name="CONTRACTLIST">
| <bean:define id="ContractVO" name="Contract" type="ContractVO" />
| <tr>
| <td>radio</td>
| <td>Name</td>
| <td>Age</td>
| </tr>
| </logic:iterate>
| </table>
| </div>
| </html:form>
| </body>
|
|
| Javascript function like this
| function fContractScrollTo('val') {
| window.scrollTo(0,document.getElementById('divCont ractID').scrollTop);
| }
|
| Is it possible to set the maintain the scrollable position in a div
| tag.
| Thanx in Advance
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.