how to hide scrollbars in netscape?

A

adrien

Hi,

(also posted in netscape.public.mozilla.browser)
i use netscape 7 and want to hide the scrollbars of the window when
something happens. I tried this:
window.scrollbars.visible=false
window.scrollbars.visibility="no"
....
nothing works
Is it also possible only to hide the vertical scrollbar instead of both?

thanks for any clue
 
D

David Dorward

adrien said:
(also posted in netscape.public.mozilla.browser)
http://www.cs.tut.fi/~jkorpela/usenet/xpost.html

i use netscape 7 and want to hide the scrollbars of the window when
something happens. I tried this:
window.scrollbars.visible=false
window.scrollbars.visibility="no"

html,body { overflow: hidden; } in the style sheet.

But what if the content won't fit in the window?
Is it also possible only to hide the vertical scrollbar instead of both?

No
 
G

Grant Wagner

adrien said:
Hi,

(also posted in netscape.public.mozilla.browser)
i use netscape 7 and want to hide the scrollbars of the window when
something happens. I tried this:
window.scrollbars.visible=false
window.scrollbars.visibility="no"
...
nothing works
Is it also possible only to hide the vertical scrollbar instead of both?

thanks for any clue

Well, you could continue to guess, or you could read the documentation:

<url: http://www.mozilla.org/docs/dom/domref/dom_window_ref104.html#1020687
/>

Pay particular attention to the "Notes" section.

--
| 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
 
A

adrien

The purpose with the scrollbars is for me to learn making dynamic webpages
with javascript with Netscape, not for publishing. When i try something, i
try until it works ..or until i realise it's impossible.
What i aimed here is to make the scrollbars hidden when the mouse tries to
reach the vertical scrollbar. With all the received info, look at this code,
please:
<BODY id="bod">
<script language="JavaScript">
var usermouse;
var limit;
limit=document.body.clientWidth * 0.9;

function test(e) {
usermouse=e.screenX
sbar=document.getElementById("bod");
if (usermouse>=limit)
{
sbar.setAttribute("style" , "overflow:hidden;");
alert("you cannot reach the vertical scrollbar");
}
else
{
sbar.setAttribute("style" , "overflow:visible;");
}
document.onmousemove=test;
}
</script>


BUT it doesn't work. Only the Alert appears but the scrollbars are still
visible. Do i do something wrong (no error in javascript console) or ...?
Thanks anyway.
 
L

Lasse Reichstein Nielsen

adrien said:
and i tried this too:

sbar.style = "overflow: hidden";

now i get the error: "setting a property that has only a getter"

It's
sbar.style.overflow="hidden";
/L
 
G

Grant Wagner

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
 
C

Carl Woffenden

DU said:
The challenge and question still remains: why would you want to remove
the scrollbars? A specific case still has not been explicited.

Lets say I'm writing a scrolling shoot 'em up for a browser. I could
just move the scrolling section by setting the top or left properties of
a containing element, but that would be very slow on older machines, so
a better way to do this would be using an IFRAME with the scrollbars
turned off.

Carl.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top