Your original function was assigning document.onmousemove=test; inside the
event handler, so it was never called. Here is a version that provides the
coordinates on the status bar (so you can see stuff happening) and that
provides the alerts you want. It does not, however, hide the scrollbars. As
has been pointed out a couple of times already, you can not remove the
scrollbars on an existing window in the default security environment. And
even with the proper security, Mozilla can be configured to defeat your
attempt to hide the scrollbars.
var limit = document.body.clientWidth * 0.9;
function test(e) {
var usermouse = e.screenX;
var sbar = document.getElementById("bod");
// watch the values to ensure this event handler is executing
window.status = usermouse + ":" + limit;
if (usermouse >= limit) {
sbar.style.overflow = "hidden";
alert("you cannot reach the vertical scrollbar");
} else {
sbar.style.overflow = "visible";
}
}
document.onmousemove = test;
thanks, that's right, i changed but ....
it still not working: i get the alert, no error anymore, but the bars are
sill visible ...
--
| Grant Wagner <
[email protected]>
* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp
* Netscape 6/7 DOM Reference available at:
*
http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
*
http://www.mozilla.org/docs/web-developer/upgrade_2.html