Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > How to find the position of a link

Reply
Thread Tools

How to find the position of a link

 
 
Chris Leonard
Guest
Posts: n/a
 
      08-31-2003
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("pic ture" &
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("pic ture" & 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


 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      08-31-2003
Anchor "#" referencing the top of the current document.
Use "javascript:void(0)" instead to nullify the link:

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


Chris Leonard <(E-Mail Removed)> wrote in message
news:bisgac$8hh$(E-Mail Removed)...
> 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("pic ture" &
> 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("pic ture" & 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Where is Form Relative Position and Absolute Position in VS.Net 2005 ? Luqman ASP .Net 1 02-07-2006 10:27 AM
RE: Link Link Link =?Utf-8?B?REw=?= Windows 64bit 0 05-17-2005 12:15 PM
Re: Link Link Link DANGER WILL ROBINSON!!! Kevin Spencer ASP .Net 0 05-17-2005 10:41 AM
How to set position of a web control depending on other control's position at run-time? James Wong ASP .Net Web Controls 4 07-14-2004 10:24 AM



Advertisments