Connecting Tech Pros Worldwide Help | Site Map

Looking for script?

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 12:02 PM
Arthur Pratz
Guest
 
Posts: n/a
Default Looking for script?

Hi all,
I am looking for a script that Upon clicking a hyperlink, Dependind on which
one in my menu, It will take me to the page, but then move or scroll
automatically down to the part they click on.
I know I didnt describe it good, but I know the scripts are out there
because I have seen them, Just dont know the correct term.
Any help appreciated,
Mike Pratz



  #2  
Old July 20th, 2005, 12:02 PM
Ivan Marsh
Guest
 
Posts: n/a
Default Re: Looking for script?

On Fri, 21 Nov 2003 20:26:12 +0000, Arthur Pratz wrote:
[color=blue]
> Hi all,
> I am looking for a script that Upon clicking a hyperlink, Dependind on
> which one in my menu, It will take me to the page, but then move or
> scroll automatically down to the part they click on. I know I didnt
> describe it good, but I know the scripts are out there because I have seen
> them, Just dont know the correct term. Any help appreciated,
> Mike Pratz[/color]

Doesn't sound like you're describing a script so much as an HTML anchor.

<A NAME='MIDDLEOFTHEPAGE>you are now at the middle of the page</A>

<A HREF="www.mysite.com#MIDDLEOFTHEPAGE">


--
i.m.
The USA Patriot Act is the most unpatriotic act in American history.

  #3  
Old July 20th, 2005, 12:02 PM
Michael Winter
Guest
 
Posts: n/a
Default Re: Looking for script?

Arthur Pratz wrote on 21 Nov 2003:
[color=blue]
> Hi all,
> I am looking for a script that Upon clicking a hyperlink,
> Dependind on which one in my menu, It will take me to the page,
> but then move or scroll automatically down to the part they
> click on. I know I didnt describe it good, but I know the
> scripts are out there because I have seen them, Just dont know
> the correct term. Any help appreciated,[/color]

If you are scrolling to the beginning of a structural or content
element (such as the heading of some text, or an image), what I'm
going to suggest below should be sufficient. If not, you'll need to
be a bit more specific (about both the menu and the content you're
linking to).

You should be able to do this simply with id attributes and fragment
identifiers. Unless you are using a drop-down menu (you didn't
specify the type of menu), you don't even have to use JavaScript.

As the id attribute is a core attribute, it exists in every BODY
level element, except in-line SCRIPTs. Place id attributes in the
locations that you will target (scroll to), then use a relative URI:

<A href="#the_target_id">...</A>

If the target is in another document, then add the filename before
the hash (#).

If you are using a drop-down menu, it's very similar:

window.location = '#the_target_id';

or

window.location = 'the_file.html#the_target_id';

Mike

--
Michael Winter
M.Winter@blueyonder.co.uk.invalid (remove ".invalid" to reply)
  #4  
Old July 20th, 2005, 12:02 PM
Michael Winter
Guest
 
Posts: n/a
Default Re: Looking for script?

Ivan Marsh wrote on 21 Nov 2003:
[color=blue]
> <A NAME='MIDDLEOFTHEPAGE'>you are now at the middle of the page</A>[/color]
^

The id attribute is preferable. Although the range of characters that
can constitute the value is limited, the id attribute can be used
with any BODY level element (except SCRIPT), so you aren't restricted
to linking to anchor elements.
[color=blue]
> <A HREF="www.mysite.com#MIDDLEOFTHEPAGE">[/color]
^

Absolute URIs should always specify the protocol.

Mike

--
Michael Winter
M.Winter@blueyonder.co.uk.invalid (remove ".invalid" to reply)
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.