Solved

JavaScript and onMouseOver and mouseTip

Posted on 2000-02-19
7
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

626 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