JS pop up...
Posted: Fri Mar 03, 2006 7:53 pm
Hello, I don't know if this question belongs in the clint side or php code topic so I just choosed one.
I am using JavaScript to make a pop box appear when the mouse mows over a button, img, ect. So the only problem I'm having is that the pop up box is to big when one of my buttons is on the right side of the page and if you know what I mean when I say this, the box becomes unable to see cause it's to wide. So what I need it to do is flip over when this happends or should I be more specific the pop up placement should should be popping up when the mouse is to far from the right it should pop up where to mouse is only plus it's width.
This is the JS:
I'm hoping that this is a simple topic to solve for every bodys sake, like a function or something. But I don't think this is going to be to hard so.
Thanks for reading and all help is appreciated.
I am using JavaScript to make a pop box appear when the mouse mows over a button, img, ect. So the only problem I'm having is that the pop up box is to big when one of my buttons is on the right side of the page and if you know what I mean when I say this, the box becomes unable to see cause it's to wide. So what I need it to do is flip over when this happends or should I be more specific the pop up placement should should be popping up when the mouse is to far from the right it should pop up where to mouse is only plus it's width.
This is the JS:
I don't know if that should be in quote tags or php but I just did quote.// ######## TRACKS MOUSE POSITION FOR POPUP PLACEMENT
var isNav = (navigator.appName.indexOf("Netscape") !=-1);
function handlerMM(e){
x = (isNav) ? e.pageX : event.clientX + document.body.scrollLeft;
y = (isNav) ? e.pageY : event.clientY + document.body.scrollTop;
}
if (isNav){document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove = handlerMM;
I'm hoping that this is a simple topic to solve for every bodys sake, like a function or something. But I don't think this is going to be to hard so.
Thanks for reading and all help is appreciated.