WEB Iframe just in area that i wanted in the middle of page

Discussion in 'OT Technology' started by basketmen, Nov 30, 2007.

  1. basketmen

    basketmen New Member

    Joined:
    Jan 31, 2007
    Messages:
    119
    Likes Received:
    0
    i use iframe from a page

    but i just need some area from that page not the entire page, lets say just 200 x 300 pixel from the middle of page

    how i can do that or what code that i need to add??? :confused:

    this is basic iframe code
     
  2. TheDarkHorizon

    TheDarkHorizon \xC0\xFF\xEE

    Joined:
    Sep 26, 2002
    Messages:
    2,396
    Likes Received:
    0
    Location:
    San Francisco, CA
    no gym for home?

    EDIT: Just figured out what you meant :o

    If you're not trying to do this cross-site, you can use JavaScript and call the scrollBy() method on the iframe, e.g., window.frames['lolframe'].scrollBy(x, y);

    The only other way I can think to do it if you are trying to do it cross-site is very hackish. You would make the iframe big enough to encompass the area you want to scroll, overlay other elements over the rest of the iframe block off the rest of the view, and then reposition the iframe where you want it. You would have to hack the rest of your template around this.
     
    Last edited: Nov 30, 2007
  3. basketmen

    basketmen New Member

    Joined:
    Jan 31, 2007
    Messages:
    119
    Likes Received:
    0
    i mean : i need a fixed width area from others page


    what code that needed???
     
  4. TheDarkHorizon

    TheDarkHorizon \xC0\xFF\xEE

    Joined:
    Sep 26, 2002
    Messages:
    2,396
    Likes Received:
    0
    Location:
    San Francisco, CA
    You'd have to do something like I said. What exactly do you need this for? There are reasons why there isn't an elegant solution to do these kind of things. Alternatively, you can create a proxy to the page and scrape the part of the page you want to use, and use the proxy as the source of your iframe.
     
  5. 420am

    420am OT Supporter

    Joined:
    Mar 10, 2003
    Messages:
    10,936
    Likes Received:
    0
    Location:
    Madison, Wisconsin
    or use php..
     

Share This Page