How to find the position of a link

C

Chris Leonard

Hi.

I have a number of links on my page. When I click on one of them I am
scrolling in a picture from the lefthand side. I have got this to work
nicely now following some suggestions made last week but with one problem
still remaining.

When I click the link the browser jumps to the top of the page and scrolls
my picture in from there. The reason is this is what I'm telling it to do by
setting the top property. How can I find the top property of the link I
clicked on so I can set it correctly ?

Here is a copy of the link

<A href="#" onClick="layername=makeName('<%Response.Write("picture" &
rcd)%>'); yhop=0; ygoal=10; xhop=40; xgoal=100; slide();">Click me</A>

I've tried:

<A id='<%Response.Write("link" & rcd)%>' href="#"
onClick="layername=makeName('<%Response.Write("picture" & rcd)%>'); yhop=0;
ygoal=10; xhop=40; xgoal=100; slide();">Click me</A>

and checked for the link(x).style.top but this doesn't work!!

Any help would be appreciated.

TIA.

Chris
 
V

VK

Anchor "#" referencing the top of the current document.
Use "javascript:void(0)" instead to nullify the link:

<a href="javascript:void(0)" onClick="...">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top