Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    Vancouver
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    This should be easy but its not it seems...

    How can I create a target to make the js hyperlink link to the <A NAME=top></A> anchor.
    So that when clicked it will scroll to the top of the page.


    Display Function In External .js File:

    function goPlus1()
    {
    eval("document.all.Page"+i+".style.display='none'");
    i=(((i%nPages)+1)%nPages);
    eval("document.all.Page"+i+".style.display=''");
    }

    Html Link:

    <A HREF="javascript:goPlus1()" CLASS=clickable>2</A>

    I hope somwone can help with this I tryed adding a target to the html link but it did not work. see website http://www.4gigs.com/~t3cat5 than select dynamic pages 2 for a example of where I did to do this.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    function goPlus1()
    {
    eval("document.all.Page"+i+".style.display='none'");
    i=(((i%nPages)+1)%nPages);
    eval("document.all.Page"+i+".style.display=''");
    top.location.href=top.location.href+'#top';
    }

    ...OR...

    function goPlus1()
    {
    eval("document.all.Page"+i+".style.display='none'");
    i=(((i%nPages)+1)%nPages);
    eval("document.all.Page"+i+".style.display=''");
    }

    <A HREF="#top" onClick="goPlus1();" CLASS=clickable>2</A>
    Last edited by beetle; 08-18-2002 at 05:25 PM.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    remember that "#top" is a quirk not recognised by mozilla; if you want it to work you must actually add that anchor name at the top of the page

  • #4
    New Coder
    Join Date
    Aug 2002
    Location
    Vancouver
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Thank you Beetles

    this should work great know why did I not think of this my mind must be going dead!! :|

  • #5
    New Coder
    Join Date
    Aug 2002
    Location
    Vancouver
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thanks brothercake

    I already did that part but thank incase I forgot to do it.


  •  

    Posting Permissions

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