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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ClientX & ClientY work, but...

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi.

I took what I learned from the 'obtaining all x,y coordinates thread' and implemented it in my page.


If you scroll down half a page and mouseover the link "amino acids" a bubble should pop up with the definition, and it does, but in the wrong spot.

What I'm looking for is a replacement to clientX/clientY that takes into account the amount scrolled... If you know what I mean.

I would be incredibly appreciative if someone could help me solve this problem.

Thanks!
-NeXius
 
Thanks...

A couple more things -- if you're not too busy -- how to I convert the function to netscape? So it's applicable in both browsers?

Here's the code:

function recordMouse()
{
if (navigator.appName == "Netscape") {
x = new Number(window.event.PageX);
y = new Number(window.event.PageY);
window.status = x + " , " + y
} else {
x = new Number(window.event.clientX);
y = new Number(window.event.clientY);
window.status = x + " , " + y
}
}

function Menu(mlayer) { // show menu @ mouse coordinates
if (navigator.appName == "Netscape") {
document.layers['total'].document.layers[mlayer].top = y-110+document.body.scrollTop;
document.layers['total'].document.layers[mlayer].left = x;
document.layers['total'].document.layers[mlayer].visibility = "visible";
} else {
document.all[mlayer].style.top=y-110+document.body.scrollTop; // subtract size of the image
document.all[mlayer].style.left=x;
document.all[mlayer].style.visibility="visible";
}
}

function MenuC(mlayer) { // close menu (on mouseout)
if (navigator.appName == "Netscape") {
document.layers['total'].document.layers[mlayer].visibility = "hidden";
} else {
document.all[mlayer].style.visibility="hidden";
}
}

It works great in IE but doesn't do anything in Netscape... Not even an error... which is weird.

You can check the original URL in the original message for a visual component to this code... I really hope you can help me, and I greatly appreciate all attempt.

Thanks,
-NeXius
 
Oh yea...

one more thing -- I swear this is the last one... In the table within the bubble, I'm considering using a read-only text box, so that I could change its value for each separate term, if that makes sense. That way, I wouldn't have to include ten different bubbles for ten different terms... I could just call function('the msg I want in the bubble') for each mouseover effect.
Anyway... Regardless of the pointless detail I included above, I need a textbox that doesn't appear as a text box -- just as normal text instead. I think there's a way... I just don't know it.

Once again, sorry to be abusing the board here (asking like 3 questions at once) but I'm desperate.

THANKS,
-NeXius
 
well, in IE you can make a text box that doesn't look like a textbox.

<input type=&quot;text&quot; style=&quot;border:0px;&quot;>

that'll be a blank white space till you put a value in it. adam@aauser.com
 
and make it readonly by adding this:

<input readonly type=&quot;text&quot; style=&quot;border:0px;&quot;>

as far as NS goes, check out my faq:

faq215-384

for official documentation. if you cannot figure it out, maybe I'll be able to help you out, but it'll take some time :)


jared@aauser.com
 
oh yeah - I think its a bug with the new site design, but I have a FAQ in the FAQs of this forum called more on official documentation. It will lead you to netscapes stuff. jared@aauser.com
 
easier way to make it readonly and crossbrowser:

onfocus=&quot;this.blur();&quot; adam@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top