Results 1 to 7 of 7

Thread: iframe content locking?

  1. #1
    Join Date
    Sep 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default iframe content locking?

    hello now I am using this code:
    Code:
    <iframe src="http://url.tld/page.php" name="frame" scrolling="auto" frameborder="no" align="center" height = "100%" width = "100%">
    I would like the first 200 dots of iframe content to be skipped (so the iframe content top is 200 dots from the real top). it should not be able to scroll up those 200 dots. is that possible?

  2. #2
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Okay, it should be possible with JavaScript using the scroll() function. i.e. scroll(0,200). Try something like this:

    Code:
    <!-- put this in the body of the page THAT IS IN THE IFRAME //-->
    <script type="text/javascript">
    window.onscroll = goback;
    function goback() {
       scroll(0,200);
    }
    </script>
    I haven't really tested it on an IFrame, but I think it will work ?
    Hope this helps you out a bit.
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  3. #3
    Join Date
    Sep 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thank you however scrolling up should not be possible. the top of the scroll bar has to be the edge of the 200 hidden dots

  4. #4
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Quote Originally Posted by coat_ View Post
    thank you however scrolling up should not be possible. the top of the scroll bar has to be the edge of the 200 hidden dots
    This should handle that. Anytime the user "scrolls" it should send them back. Are you talking about getting rid of the scroll bar?
    Or do you mean that you want them to be able to scroll down and not up?
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  5. #5
    Join Date
    Sep 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    the scrol lbar should be at its top at 200 pixels below the ac tual content top

  6. #6
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    You won't be able to do that to my knowledge.

    //EDIT: sorry for the plain response, but I am short on time here at work right now. I will try to explain better when I get the time; unless someone else wants to handle this one.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  7. #7
    Join Date
    Sep 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    this see ms to work seperately. can you show how to integrate proper ly? the page goes bad now.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang='en'>
    <head>
    <meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>
    <meta name="description" content="">
    <meta name="keywords" content="">
    <title>Untitled</title>
    <!-- link rel='stylesheet' href='/include/style.css' type='text/css' -->
    <style type="text/css">
    <!--
    body {
       padding: 0 520px 0 0;
    }
    #test {
       width: 500px;
       height: 700px;
       overflow: auto;
       position: absolute;
       top: -200px;
       right: 0;
    }
    -->
    </style>
    </head>
    <body>
    <h1>This is a test.</h1>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
    veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
    commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
    velit esse cillum dolore eu fugiat nulla pariatur.</p>
    <iframe id="test" src="http://www.google.com"></iframe>
    </body>
    </html>

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
  •