[TriLUG] "Magic" navigation

Allen Freeman knieveltech at yahoo.com
Tue Oct 23 12:12:36 EDT 2007


So if I'm understanding you, you're wanting to be able to automate scrolling down to $N element on the page? 

detecting element coordinates:
http://www.quirksmode.org/js/findpos.html

discussion of various window. methods, scrollTo may be of interest:
http://www.devguru.com/Technologies/ecmaScript/quickref/window.html

I hope this helps.

-Allen Freeman

----- Original Message ----
From: Brian McCullough <bdmc at bdmcc-us.com>
To: Triangle Linux Users Group discussion list <trilug at trilug.org>; TriPUG <tripug at lists.tripug.org>
Sent: Tuesday, October 23, 2007 10:17:40 AM
Subject: [TriLUG] "Magic" navigation

Folks,

I have been working on this for more than a month ( with interruptions
), so am finally asking for help.


I have a PHP web page that calls itself ( <form action="me.php" ) in
response to buttons being clicked on the page.

This page shows various blocks of content -- think "paragraphs" -- in
response to a set of buttons at the top, a sort of navigation area.   One
or more of these buttons may be clicked randomly, exposing or hiding
some of the page's content.

So far, so good.

However, the client also wants to be able to go to the location of the
text that was exposed by the last button click.  ( We won't talk about
what happens when that text is hidden by the click. )

In the past, I have used a neat bit of JavaScript that will return you
to the location of a button that is clicked in a form, but that won't
work here, because all of the buttons are at the top and the actual
targets are farther down.

Because the location of the block of text can vary, depending on the
number of blocks that exist above that block, I don't see any practical
way of recording that location _before_ the page is re-drawn.

I have tried putting bits of JS into the page, trying to "remember" the
location of each block as it is drawn, and then doing a "GoTo" at the
bottom of the page, but that doesn't seem to do anything; it just goes
to the top.

I thought of "anchors" attached to each block, and putting a
"hash-target" on the form action, but that would have to be known before
the button was clicked, wouldn't it?

In any case, I have run into too many walls, and so am asking whether
anybody else can offer suggestions leading me to a solution.


Thank you,
Brian


-- 
TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
TriLUG Organizational FAQ  : http://trilug.org/faq/
TriLUG Member Services FAQ : http://members.trilug.org/services_faq/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the TriLUG mailing list