Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to find the x-y position of a span

Status
Not open for further replies.

TravisLaborde

IS-IT--Management
Nov 4, 2002
84
US
I'm using IE6 as the browser, and here is what I'm trying to do:

I have a span with plain text, such as a name. I have set up the _onMouseOver() event of this span as follows:

sub mySpan_onMouseOver()
set e = window.event
var = "y: " & e.ClientY & " x: " & e.ClientX
msgbox var
end sub

My intent was to find the "position" of the span. However, it seems I'm finding the position of the mouse instead.

Because if I hover near the left side of the span, I get different results than if I hover near the right side of the span.

This is a problem, because I'm actually using these coordinates to position another span (a popup), and I'd like it to always appear relative to the original span instead of relative to the mouse.

Can anyone help me with this?
Thanks,
Travis
 
Travis

I don't know what kind of object a 'span' is, but doesn't it have properties like top,left, etc? That's what you're trying to get at aren't you, not where the mouse is.

Are you trying to trigger the pop up when the user 'hovers' over your span (i.e. without a click)?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top