Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Mar 2007
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hide disable scrollbar

    Hello,

    May anyone teach me how do I can hide (disable) scroll bar when I click on "show form" although show form is link.

    Please note: is this code ok?

    <head>
    <title>Show Hide Scrollbars</title>
    <script name="Detect Browser" language="Javascript">
    var detect = navigator.userAgent.toLowerCase();
    var browser,thestring;

    if (checkIt('msie'))
    {
    browser = "Internet Explorer";
    }
    else if (!checkIt('compatible'))
    {
    browser = "Netscape Navigator";
    }
    else browser = "An unknown browser";

    function checkIt(string)
    {
    place = detect.indexOf(string) + 1;
    thestring = string;
    return place;
    }
    </script>
    <script
    name="Add and Remove Scroll Bars" language="Javascript">
    function noScrollIE()
    {
    document.body.scroll="no";
    }
    function scrollIE()
    {
    document.body.scroll="yes";
    }
    function noScrollNS()
    {
    document.width= window.innerWidth;
    document.height=window.innerHeight;
    }
    function scrollNS()
    {
    document.width=1000;
    document.height=1000;
    }
    </script>
    <script "Do the work" language="Javascript">
    function removeScrollBars()
    {
    if (browser = "Internet Explorer")
    {
    noScrollIE();
    }
    else if (browser = "Netscape Navigator")
    {
    noScrollNS();
    }
    }
    </script>
    </head>

    <body onload="removeScrollBars()">
    <a href="javascript:noScrollIE();">IE Scrollbars Off</a><br>
    <a href="javascript:scrollIE();">IE Scrollbars On</a><br>
    <a href="javascript:noScrollNS();">NS Scrollbars Off</a><br>
    <a href="javascript:scrollNS();">NS Scrollbars On</a><br>
    </body>
    Regards
    Last edited by snake_eyes; 05-15-2007 at 11:09 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •