Results 1 to 4 of 4

Thread: How do write anchor tag script?

  1. #1
    Join Date
    Sep 2008
    Location
    New Delhi
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb How do write anchor tag script?

    Hi,

    I m very please for having membership of this forum.

    I m looking for anchor tag script, like when someone click on any image or text, it goes to that particular paragraph in the same page.

    How can I write this anchor tag script?

    zapinfotech
    Last edited by zapinfotech; 09-28-2008 at 05:08 PM. Reason: removed signature

  2. #2
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 130 Times in 117 Posts

    Default

    that's easy.

    Let's say you have a paragraph in your page you would like to have the user be able to navigate to. You would need to add an "ID" to that paragraph like this...

    Code:
    <p id="name_me_something">
    This is a bunch of meaningless text...
    </p>
    Then to make a link to that paragraph, simply use this..

    Code:
    <a href="#name_me_something">Click to go to paragraph</a>
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  3. #3
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 130 Times in 117 Posts

    Default

    forgot to mention, you could also link to that specific paragraph from ANOTHER page...

    Let's say you have a link on "Page 2" that you want to go to "Page 1 - Paragraph 2", you would first need to create the paragraph in page 1 and give it an ID "paragraph-2".

    Code:
    <p id="paragraph-2">
    This is random text...
    </p>
    Then on page 2, you would make the link like this...

    Code:
    <a href="page1.html#paragraph-2">Click to go to page 1- paragraph-2</a>
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  4. The Following User Says Thank You to TheJoshMan For This Useful Post:

    Maynard (10-12-2008)

  5. #4
    Join Date
    Sep 2008
    Location
    New Delhi
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks buddy

    its working

    zapinfotech

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •