how to hide scrollbars in netscape?

Discussion in 'Javascript' started by adrien, Jul 22, 2003.

  1. adrien

    adrien Guest

    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
    adrien, Jul 22, 2003
    #1
    1. Advertising

  2. adrien wrote:

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

    --
    David Dorward http://david.us-lot.org/
    David Dorward, Jul 22, 2003
    #2
    1. Advertising

  3. adrien

    Grant Wagner Guest

    adrien wrote:

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

    * 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
    Grant Wagner, Jul 22, 2003
    #3
  4. adrien

    adrien Guest

    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.


    "DU" <> wrote in message
    news:bfke6r$een$...
    > adrien wrote:
    > > 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
    > >
    > >

    >
    > Why would you want to remove the scrollbars when the content overflows
    > the window dimensions? ... because this is why and when scrollbars

    appear..
    >
    > The user can override even a html, body {overflow:hidden;} css
    > declaration by editing an userContent.css and have html, body
    > {overflow:visible !important;} or {overflow:auto !important;}.
    >
    > And the user.js file can take care of "scrollbars=no" in the
    > window.open() calls with
    > user_pref("dom.disable_window_open_feature.scrollbars", true);
    >
    > What you are asking to do is counter-accessibility and is anti-user.
    > Preventing to notice that overflowed content is clipped and preventing
    > to access, to reach via scrollbars such clipped content just can not be
    > in the objective interests of the web designer and in the objective
    > interests of the visitors/users/customers.
    >
    > DU
    > --
    > Javascript and Browser bugs:
    > http://www10.brinkster.com/doctorunclear/
    >
    adrien, Jul 23, 2003
    #4
  5. "adrien" <> writes:

    > 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
    --
    Lasse Reichstein Nielsen -
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
    'Faith without judgement merely degrades the spirit divine.'
    Lasse Reichstein Nielsen, Jul 23, 2003
    #5
  6. adrien

    Grant Wagner Guest

    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;

    adrien wrote:

    > thanks, that's right, i changed but ....
    >
    > it still not working: i get the alert, no error anymore, but the bars are
    > sill visible ...
    >
    > "Lasse Reichstein Nielsen" <> wrote in message
    > news:...
    > > "adrien" <> writes:
    > >
    > > > 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


    --
    | Grant Wagner <>

    * 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
    Grant Wagner, Jul 23, 2003
    #6
  7. DU wrote:

    > 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.
    Carl Woffenden, Jul 25, 2003
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. My Liege
    Replies:
    6
    Views:
    355
    Steve Pugh
    Jul 31, 2003
  2. rf
    Replies:
    1
    Views:
    323
    My Liege
    Jul 30, 2003
  3. Ben
    Replies:
    5
    Views:
    441
    My Liege
    Jul 31, 2003
  4. Steve Pugh
    Replies:
    3
    Views:
    373
    Steve Pugh
    Aug 1, 2003
  5. Hywel Jenkins
    Replies:
    2
    Views:
    389
    My Liege
    Jul 30, 2003
Loading...

Share This Page