www.webdeveloper.com
Results 1 to 6 of 6

Thread: Disabling Scroll bars in a Frame

  1. #1
    Join Date
    Aug 2004
    Posts
    28

    Disabling Scroll bars in a Frame

    I want to take off the Scroll bars of a frame in a FrameSet. I have used the following code to disable all the scroll bars of all the frames and it displayes the new value correctly as "no" from the msgBox. But the Scroll bars are still present in the frames.

    FOR EACH loFrame IN top.document.all.tags("FRAME")
    loFrame.scrolling = "no"
    msgbox loFrame.name + " - " + loFrame.scrolling
    NEXT

  2. #2
    Join Date
    Nov 2002
    Location
    Dartmoor [Holiday]
    Posts
    2,382
    Try this (JavaScript):

    Code:
    <script type="text/javascript">
    for (var i=0;i<frames.length;i++)
      frames[i].document.body.style.overflow = 'hidden';
    </script>
    Adam
    "If youíre not using valid HTML, then you havenít created a Web page. You may have created something else, but it isnít a Web page." - Joe Clark

    Do something amazing (USA) | Make Poverty History

  3. #3
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    probably a CSS solution is better that a javascript one. The main disatvantage is that you must modify each of your framed pages by inserting a CSS code...

  4. #4
    Join Date
    Aug 2004
    Posts
    28
    Thanx for this. the scroll bars are taken off with this coding , so that i can get wht i want. But its better if theres a way to DISABLE the scroll bars...

    Originally posted by AdamGundry
    Try this (JavaScript):

    Code:
    <script type="text/javascript">
    for (var i=0;i<frames.length;i++)
      frames[i].document.body.style.overflow = 'hidden';
    </script>
    Adam

  5. #5
    Join Date
    Nov 2002
    Location
    Dartmoor [Holiday]
    Posts
    2,382
    I'm not aware of any way to reliably disable the scrollbars while leaving them visible and greyed out, but I think some versions of IE do this with the code I provided.

    Adam
    "If youíre not using valid HTML, then you havenít created a Web page. You may have created something else, but it isnít a Web page." - Joe Clark

    Do something amazing (USA) | Make Poverty History

  6. #6
    Join Date
    Jan 2004
    Location
    Canada
    Posts
    13
    In IE you can use <body scroll="no">

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles