Re: datagrid in a div for scrolling question
Tech-Archive recommends: Fix windows errors by optimizing your registry
You can trap the onscroll event in javascript and store the scroll
position in a hidden input field. Then put some more script into
window.onload to pull that position out of the hidden field and set the
scroll position.
Here is a quick example that should get you pointed in the right
direction. It has all the client code you'll need (in IE, at least):
<div id="divTest" style="width:200;height:100;overflow:auto"
onscroll="divTest_onscroll()">
put a bunch of text here so that the scrollbars will display...
</div>
<script>
function divTest_onscroll()
{
var div = document.getElementById("divTest");
alert(div.scrollTop);
}
function SetScroll()
{
var div = document.getElementById("divTest");
div.scrollTop = 50;
//alert(div.scrollTop);
}
SetScroll();
</script>
Good luck!
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
.
Relevant Pages
- Re: Odd border round image link
... >> Stephen's script works fine but POTW's is better (I put it at the bottom ... > Just be satisfied with the dots vanishing as soon as they've done their job. ... a framed page the focus is the frameset, I'd like to make it the main ... content page so users get the same "click to the page and scroll down" ... (uk.net.web.authoring) - Re: Difficulties in deriving a truly universal GUI Scripting Language
... interpretation, but yes, it *is* possible, although unlikely, the caret ... Even the rich edit control, in one of the most glaring API oversights I've ... In that case the script author would have to have the script do the same ... of spontaneously scroll underneath you. ... (microsoft.public.vc.mfc) - Re: "Freeze Panes" in table to make body scrollable
... > CSS theme: ... the header is not fixed in Opera 7.5, ... scroll bar and when you scroll it the header cells don't line up with ... As my script demonstrates that all of these things can be done, ... (comp.lang.javascript) - Re: Difficulties in deriving a truly universal GUI Scripting Language
... interpretation, but yes, it *is* possible, although unlikely, the caret ... Even the rich edit control, in one of the most glaring API oversights I've ... In that case the script author would have to have the script do the same thing ... of spontaneously scroll underneath you. ... (microsoft.public.vc.mfc) - RE: Built-In JavaScript-Rendering Functions
... As for the script rendering and manipulating functions in ASP.NET 2.0 you ... to scroll to a specific anchor or to the top or bottom of the page. ... We may still have to use some custom client-side ... for registering script code that will be executed after the page get loaded ... (microsoft.public.dotnet.framework.adonet) |
|