...

View Full Version : This should be easy but its not it seems...



t3cat5
08-18-2002, 02:04 PM
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.

beetle
08-18-2002, 04:21 PM
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>

brothercake
08-18-2002, 04:37 PM
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

t3cat5
08-18-2002, 05:15 PM
this should work great know why did I not think of this my mind must be going dead!! :|

t3cat5
08-18-2002, 05:18 PM
I already did that part but thank incase I forgot to do it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum