Solved

JavaScript and onMouseOver and mouseTip

Posted on 2000-02-19
7
191 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

760 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

19 Experts available now in Live!

Get 1:1 Help Now