PDA

View Full Version : JScript? - Moving to specific point on grid layout page


jonirvine
08-18-2004, 12:55 PM
Hello all,

Been trying to work out if this is possible.

Let's say you have a grid style web page with 20+ squares (using tables or absolutely positioned layers) each 500x500 pixels.

Is there anyway to create navigation links so when a person clicks them, they take the user to the same page with specified x/y values in the top left corner?

Hope that makes sense.

Jon

P.S. I've tried regular anchor tags, but they take the user to a point where the anchor is on the right hand side of the browser, thus missing the content of the rest of the box.

¥åßßå
08-18-2004, 01:20 PM
Would I be right in thinking that your trying to make a "multi-page" site with 20 pages on the same page ?

If so, you can create 20<div>s and show/hide them to achieve the same end result, however, it would require javascript to function.

¥

jonirvine
08-18-2004, 01:28 PM
Hi,

Yes. I trying to create a site which consists of 20 seperate pages, but all within 1.

Hiding and showing the layers isn't an option as each of the 20 will merge into one another and I want people to be able to use both scrollbars as well as the navigation.

Been looking around for an hour or so for a solution, but nothing so far. Must be possible.

Just to summarise.....

Want some javascript (or anything) that can take a user to the same page but a specified number of pixels inwards and downwards.

Jon

¥åßßå
08-18-2004, 01:35 PM
If my memory serves me correctly :-
document.body.scrollIntoView(x,y) is what you need.

But I'm not sure how cross-browser this is.

¥

jonirvine
08-18-2004, 02:21 PM
ah ah... cheers. Am getting somewhere with it. Cheers!

Here's what I have so far.

www.designition.co.uk/messin/layers.php

Works perfectly on PC/IE6

In Netscape 7.1/Moszilla1.5 it works kind of. Problems being it doesn't take the div right to the left and it wont move to ones that are one the same page.

Any ideas how the Netscape issue could be resolved?

Also....

Can eveyone who looks at it check it works in their browsers and let me know if they have problems and what they're using!

Thanks,

Jon

¥åßßå
08-18-2004, 05:39 PM
Try scrolling to 0,0 and then your destination x,y a split second later.