Looking for script?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Arthur Pratz

    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


  • Ivan Marsh

    #2
    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='MIDDLEOFT HEPAGE>you are now at the middle of the page</A>

    <A HREF="www.mysit e.com#MIDDLEOFT HEPAGE">


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

    Comment

    • Michael Winter

      #3
      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_targ et_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@blueyo nder.co.uk.invalid (remove ".invalid" to reply)

      Comment

      • Michael Winter

        #4
        Re: Looking for script?

        Ivan Marsh wrote on 21 Nov 2003:
        [color=blue]
        > <A NAME='MIDDLEOFT HEPAGE'>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.mysit e.com#MIDDLEOFT HEPAGE">[/color]
        ^

        Absolute URIs should always specify the protocol.

        Mike

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

        Comment

        Working...