Dude101
05-13-2003, 08:34 PM
I put an applet on a website that scrolls an image across the screen. When someone clicks on part of the image he is sent to a new window in that frame describing the area pictured. Only problem I'm having is when he returns to the original scrolling image he has to start at the beginning of the scroll.
I'd like to return him to the point in the image where he left.
I wrote the author of the applet and he wrote the following that exceeds my knowledge of JS. Any help supplying an example would be appreciated.
"I have take a look at your page and it looks great! You can make the scroller start at the same point when the user returns to the page by JavaScript. It's require some knowledge of JavaScript, and I only have time to point out a solution: Use the JavaScript onLoad() and onRefresh() functions to call your own function which will call the scrollers jump(x,y) function. In your JavaScript code you have to store the users position when leaving the page by the getCursorX() and getCursorY(). The JavaScript variables have to be stored in variable declared as var, eg var x,y; and prefeable in a JavaScript sourcefile, which speed it all up."
The page is located at: www.gokadar.com/base_pages/tour/example3/tour3.htm
I tried this:
<a href="../panorama.html JavaScript:jump(1714,40)" target="scroller" >Return
to Panorama</a>
after I placed the jump function that came with the applet in the heading section:
// Functions to jump to last location
function jump(x,y)
{
document.scroller.setPos(x,y);
}
Am I even close on this one? Don't laugh too hard..
dude101
I'd like to return him to the point in the image where he left.
I wrote the author of the applet and he wrote the following that exceeds my knowledge of JS. Any help supplying an example would be appreciated.
"I have take a look at your page and it looks great! You can make the scroller start at the same point when the user returns to the page by JavaScript. It's require some knowledge of JavaScript, and I only have time to point out a solution: Use the JavaScript onLoad() and onRefresh() functions to call your own function which will call the scrollers jump(x,y) function. In your JavaScript code you have to store the users position when leaving the page by the getCursorX() and getCursorY(). The JavaScript variables have to be stored in variable declared as var, eg var x,y; and prefeable in a JavaScript sourcefile, which speed it all up."
The page is located at: www.gokadar.com/base_pages/tour/example3/tour3.htm
I tried this:
<a href="../panorama.html JavaScript:jump(1714,40)" target="scroller" >Return
to Panorama</a>
after I placed the jump function that came with the applet in the heading section:
// Functions to jump to last location
function jump(x,y)
{
document.scroller.setPos(x,y);
}
Am I even close on this one? Don't laugh too hard..
dude101