SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    iFrame with constant scrollbars?!

    I'm trying to figure out how to have an iframe with constant scrollbars so the scrollbars are visible even though there is nothing to scroll!

    I have this now:
    Code:
    <script type="text/javascript">
    function ChangeScrollState (select) {
    	var iframe = document.getElementById ("thisIframe");
    	var frameDoc = iframe.contentWindow.document;
    	frameDoc.documentElement.style.overflow = select.value;
    }
    </script>
    
    <iframe id="thisIframe" src="testpage.php" /></iframe>
    
    <select onChange="ChangeScrollState (this);" size="3">
        <option value="auto"  />auto
        <option value="scroll" selected="selected" />show
        <option value="hidden" />hide
    </select>
    If I hit the option with scroll I get what I want, but how do I make this static?

    Hoping for help :-)

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    adding the attribute scrolling="yes" in the iframe tag should work.

    see http://www.w3schools.com/tags/tag_iframe.asp

  3. #3
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Vlinder View Post
    adding the attribute scrolling="yes" in the iframe tag should work.]
    Not really... Using scrolling="yes" will only show the scrollbars if there is something to scroll... I need the scrollbars visible even though there is nothing to scroll...


Bookmarks

Posting Permissions

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