Menu
Hi,
I have an Iframe on a HTML page which contains another web page.
I want to be able to move the main scrollbar which is outside of the Iframe from web page inside the Iframe.
I’m using JavaScript to do this.
I have tried both window.top.scrollto(0,0) and window.scrollto(0,0) but this doesnt work?
I thought that window.top.scrollto(0,0) would work but I get Access Denied JavaScript Error.
Can someone please let me know if I can do this?
thanks,
Paddy
I'm only responsible for the web which is inside
[/quote]
function getPrevScroll(){
if (document.cookie)
{
posStr = document.cookie;
startSlice = posStr.indexOf("=");
endSlice = posStr.length;
lastPos = posStr.substr(startSlice+1,endSlice);
lastPos = lastPos.split(":");
parent.frames.window.scrollTo(lastPos[0],lastPos[1]);
}
}
function saveScroll(){
xSave = parent.frames.document.body.scrollLeft;
ySave = parent.frames.document.body.scrollTop;
document.cookie = "scrollPos"+"="+xSave+":"+ySave;
}
window.onload=getPrevScroll;
window.onbeforeunload=saveScroll;
0.1.9 — BETA 5.18