Hi,
i have two div in my asp.net page and a datagrid in each one of them.
when i scroll a div and then edit an item the grid scroll back on top, so i must return to the selected item.
How can i make thi automatically with a script?
I tried this but it doesn't work :
function setCoordinates()
{
var myPageX;
var myPageY;
if (document.all)
{
myPageX = document.body.scrollLeft;
myPageY = document.body.scrollTop;
}
else
{
myPageX = window.pageXOffset;
myPageY = window.pageYOffset;
}
document.getElementById('PosX').value = myPageX;
document.getElementById('PosY').value = myPageY;
}
function SmartNav()
{
window.scrollTo(document.getElementById('PosX').value, document.getElementById('PosY').value);
}
and set
body.onscroll = setCoordinates
div.onscroll = setCoordinates
body.onload = SmartNav
Any suggest?
thanks
i have two div in my asp.net page and a datagrid in each one of them.
when i scroll a div and then edit an item the grid scroll back on top, so i must return to the selected item.
How can i make thi automatically with a script?
I tried this but it doesn't work :
function setCoordinates()
{
var myPageX;
var myPageY;
if (document.all)
{
myPageX = document.body.scrollLeft;
myPageY = document.body.scrollTop;
}
else
{
myPageX = window.pageXOffset;
myPageY = window.pageYOffset;
}
document.getElementById('PosX').value = myPageX;
document.getElementById('PosY').value = myPageY;
}
function SmartNav()
{
window.scrollTo(document.getElementById('PosX').value, document.getElementById('PosY').value);
}
and set
body.onscroll = setCoordinates
div.onscroll = setCoordinates
body.onload = SmartNav
Any suggest?
thanks