Solved

JavaScript and onMouseOver and mouseTip

Posted on 2000-02-19
7
193 Views
Last Modified: 2008-03-04
I have a left-contents frame which is: without a scrollbar
and contains one tablecell with no-wrap set to true.

Some of the text in the frame is to long to be shown, because of the narrow frame.

The text in the table-cell looks like this:
Home
Gallery
  Gallery 1
  Gallery bla bla bla
  Gallery bla bla bal balablal

Is there a way in JavaScript to get the
x and y position of the text to i.e. 'Gallery1'?

And then call a function that displays the text in a similar way using the "Title="Gallery1" in IE which displays a mouse tip (beneath the mouse)...BUT!!! I want the mouse tip to be shown hopefully exactly over the original text (or as close as possible)

It is important that this customMouseTip is shown over the main-frame at the right of the contents-frame.

So why do I not use the Title="something" in IE... Well I want it to work in several browsers...

Thanks...

Erot
0
Comment
Question by:erot
7 Comments
 

Author Comment

by:erot
ID: 2537994
To see what I want, you can open the windows explorer.
Default it opens with 'two frames'
if you resize the left frame so some of the text is hidden, and then move the mouse pointer over text that is partly hidden behind the 'right-frame' then there will pop up a mousetip, exactly over the original text....

Erot
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 2538155
This won't behave exactly that way, but you could use the "title" attribute:

<A href="www.nfl.com" title="Visit the NFL">Visit the NFL</a>

.... title also works on buttons, textareas, and other form elements (but not selects), also in div and layer tags.
0
 

Author Comment

by:erot
ID: 2538203
Hello knightEknight
Did you read my question??

As I know it Title tag do not work with netscape.... and this is one of the reasons I want to do it with JavaScript.

Please answer the questions.....

Erot
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 8

Expert Comment

by:jbirk
ID: 2538333
I don't believe it is possible to have a layer leave the constraints of the document (overlap the other frame) unless you get a priviledge in Netscape.  In IE, I have no idea if it's even possible...

Anyway, it's probably not worth signing your script for something like this.

Good luck!

-Josh
0
 
LVL 7

Expert Comment

by:nettrom
ID: 2539557
it's impossible to have layers crossing two frames, the browsers give each frame its own window instance, and layers can't go across windows.  so you'll have to have the tooltips in either the left or the right frame, and only there.

to answer the x&y-coordinate-question, yes, it's possible.  if you name your links (so they become anchors) the x&y-coordinates can easily be found (they can also be found keeping the links unnamed, but it's easier when they are named).

document.anchors['anchor_name'].x
document.anchors['anchor_name'].y

gives the x & y coordinates in Netscape 4.x.  getting the same coordinates in Internet Explorer is slightly more tricky because IE has an "offset to paren" way of doing things, and the offset is calculated relating to the parent element.  therefore, some fiddling around with functions is needed (since your links are inside a table).  example showing how to get Y-coordinate of an item:

MTMyval = MTMGetPos('anchor_name');
function MTMGetPos(myObj) {
  return(myObj.offsetTop + ((myObj.offsetParent) ? MTMGetPos(myObj.offsetParent) : 0));
}

to get the X-coordinate, copy the function, rename it, change "offsetTop" to "offsetLeft".
0
 

Author Comment

by:erot
ID: 2567954
To Nettrom.
Please put in some text so I can give you the points.

Erot
0
 
LVL 7

Accepted Solution

by:
nettrom earned 150 total points
ID: 2567999
glad I could help. thanks. :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Login area of a page 4 32
Using Classic ASP inside HTML pages 2 56
Full Screen problem when auto scale IFRAME 2 61
Enter key on html form page 11 47
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now