Results 1 to 7 of 7

Thread: Iframe problem.

  1. #1
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Iframe problem.

    I'm very bad in english, but i try to explain my problem as good as i can.

    I'm using Iframe to include page (For example, google.) in my site.
    I've tried to divs and many methods to get iframe like this: (Its hard to explain, so i made image, SECOND image )


    TO


    So, how i can make iframe box with no scrolling, and what automaticly
    center it in one point. (Look second image, its help to understand)

    As i before said, i've tried divs, and other things, but they are very bad,
    and they aren't working on other broswers, like firefox.

    Im glad if anyone can help with this, i hope you understand my english.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This looks OK for the American Google:

    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">
    .goo {
    width:480px;
    height:111px;
    position:relative;
    overflow:hidden;
    }
    .goo iframe {
    width:480px;
    height:350px;
    position:absolute;
    top:-150px;
    left:-20px;
    }
    </style>
    <!--[if IE]>
    <style type="text/css">
    .goo iframe {
    left:0;
    }
    </style>
    <![endif]-->
    
    </head>
    <body>
    <div><br>&nbsp;</div>
    <div class="goo"><iframe src="http://www.google.com" scrolling="no" frameborder="0"></iframe></div>
    </body>
    </html>
    But, if anyone used it, the results would be in the same iframe and mostly obscured by its size, lack of scrolling, and the division above it which partially masks it.

    Note: Google does offer free or cheap code to put their search on your page.
    - John
    ________________________

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

  3. #3
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much, i've searched code like this long time.
    Thank you !

  4. #4
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    Hey guys,

    I used the above code mentioned, and the one in this link http://www.dynamicdrive.com/forums/s...ad.php?t=22424 , but I always can only see a part of the width I place. Does it interfere with other divs I have on my site ? Here's the css
    Any ideas ?

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    chechu,

    In the beginning, I answered this thread just to see if I could get it to work. I knew without trying that it wasn't that good of an idea, especially with something like Google, for the reason I mentioned in my previous post. There are other reasons that would apply to any such setup, however it is done:

    1. The content provider may change their layout, throwing off all your previously calculated dimensions.
    2. It is a mild form of stealing content.
    3. You have no control over the content. This means that you must test in every browser because you cannot know with any certainty how the layout and styles of the provider, once placed in your iframe will react with any given browser.
    4. The content you are taking/using may change address or simply stop being provided.
    - John
    ________________________

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

  6. #6
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    The content provider may change their layout, throwing off all your previously calculated dimensions.
    It is a mild form of stealing content.
    The content you are taking/using may change address or simply stop being provided.
    No problem, as the content of the iframe would be of another site of mine ...
    You must test in every browser because you cannot know with any certainty how the layout and styles of the provider, once placed in your iframe will react with any given browser.
    This could worry me. But if you look at my stylesheets, is there something that could cause the problem ?

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by chechu View Post
    No problem, as the content of the iframe would be of another site of mine ...

    This could worry me. But if you look at my stylesheets, is there something that could cause the problem ?
    Mmm, well then let us first be sure that the test page I provided works for you in your current browser. If it does, try adding it to your page while keeping American Google as the content. If that still looks good, switch to your content. At this point, you will probably need to adjust some of the styles. It was only worked out for American Google.
    - 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
  •