Results 1 to 5 of 5

Thread: Reduce content of iframe

  1. #1
    Join Date
    Aug 2006
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Reduce content of iframe

    http://www.dynamicdrive.com/dynamici...loatiframe.htm

    I like to reduce the size of the content which I am showing in an iframe. I don't want to use scroll for the iframe. I my dream would be to just zoom out the the content of the page I am showing. The content I am showing is a page for the web so I don't have a way to change and ad scripts there.

    I found a php script but I was wondering any other way. If not could I show the content in a lightbox or graybox but the would really my second choice

    Cheers
    Last edited by stefaneh; 02-27-2007 at 11:19 AM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,994
    Thanks
    43
    Thanked 3,198 Times in 3,160 Posts
    Blog Entries
    12

    Default

    You cannot access the content of an iframe from another domain to change it without something like PHP. However, in IE you can do zoom style. With PHP as a fall back for other browsers it might be good to use the IE method for those browsers that support it (less server overhead). Here is an example (IE only):

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    iframe {
    zoom:50%;
    border:2px solid black;
    }
    </style>
    </head>
    <body>
    <iframe src="http://www.google.com/" width="500" height="400" scrolling="auto" frameborder="1"></iframe>
    </body>
    </html>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2006
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks John that works for IE same not for Firefox. I try now to block the horizontal scroll bar . I tried to use "vertScroll" to display only the vertical bar but still the horizontal shows up. How can I do this? As well anyway I can crap the content of the iframe and move it with my mouse rather then with the scroll bar?

    Thanks again John you are a legend

  4. #4
    Join Date
    Aug 2006
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default fix the scrollbar

    John,
    I fixed the scrollbar issue via CSS overflow. Any chance I can disable hyperlinks shown inside the iframe?

    Thanks

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,994
    Thanks
    43
    Thanked 3,198 Times in 3,160 Posts
    Blog Entries
    12

    Default

    There are probably various ways to do that, here's one:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    iframe {
    zoom:50%;
    border:2px solid black;
    }
    </style>
    </head>
    <body>
    <div style="position:relative;width:250px;height:200px;">
    <iframe src="http://www.google.com/" width="500" height="400" scrolling="auto" frameborder="1"></iframe>
    <div style="position:absolute;width:500px;height:400px;zoom:50%;top:0;left:0;background-color:white;filter:alpha(opacity=1);opacity:0.01;"></div>
    </div></body>
    </html>
    The styles can be set in the stylesheet if you prefer (probably a good idea).
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •