Results 1 to 10 of 10

Thread: IFRAME needs some adjustments

  1. #1
    Join Date
    Feb 2010
    Posts
    27
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default IFRAME needs some adjustments

    I have a working iframe.

    When you click on the iframe it opens fullscreen and replaces the page. How do I add . . .target_"blank". . . or the equivalent to my html so that the iframe opens on a new tab when I click on it?

    Thanks in advance!
    bill.onthebeach

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    <a href="...." target="_blank">

    Just add that to every link.

    And you can also use target="_self"> or target="this_iframe's_name".

    You can also use a <base> tags in the head section:
    <head>....<base target="_blank"></head>
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Feb 2010
    Posts
    27
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default should have included code the first time . . . sorry

    <iframe id="fbif" src="http://....." width="100%" height="65" frameborder="0" scrolling="no"></iframe>

    I added target="_blank" after scrolling but it did not do what was intended. the code was ignored and the problem described above persisted.

    There are no other links to be concerned with.

    thanks!
    bill.onthebeach

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Add it to the link tags (<a>), not the iframe tag. You modify the code OF the iframe page, not of the main page.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Feb 2010
    Posts
    27
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I must be missing something important here. as it stands right now, there is no <a> tag, nor do I see where one should be.

    It's a simple page. Iframe in the top 10%; main page at the bottom.

    no more. no less.

    please show me an example of your recommendation.
    thanks!

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    An iframe is a tag that embeds page B into page A. The code that I am talking about is used on page B, NOT on page A (the main page).
    You cannot control many of the properties of an iframe from its parent, but rather must do it from the iframe's html itself.
    In other words, if you are embedding an external site in your own, you cannot control what that does, such as using target="_parent" to prevent you from keeping their site in an iframe.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #7
    Join Date
    Feb 2010
    Posts
    27
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    if I understand you correctly, so since the code above is an "external" webpage in my iframe, I have no control over the terms of the "onclick" that opens the iframe fullscreen.

    For what it is worth, if it was an "internal" (that is one of mine) website in the iframe, I still don't see where to write the html code on page B that sets the "onclick" to target="_blank".

    Would it be a <a ........... /> at the top of Page B?

    thanks!

  8. #8
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Yes, external pages are completely out of your control. This is the way that the web is designed, in favor of giving control to the host rather than the website that embeds it. This makes sense, though it can be frustrating.


    "onclick" is a Javascript property of tags: <X onclick="dothis();">.
    (for this, you'd use Javascript to determine the action/target/etc...)

    If you are talking about LINKS then <a> tags MAKE links. For each link, <a>...</a> surrounds it (a = anchor, which among other things makes links). For each of these, add the target="_blank" property.
    You can use the <base> tag in my above post to the <head> section if you want this to be the case for every link (by default, unless you otherwise specify on that <a> tag).
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  9. #9
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Link to the page.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  10. #10
    Join Date
    Apr 2010
    Location
    UK
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default IFRAME needs some adjustments

    I cleaned up the html but the iframe still moves around. is there a way to make it stay in one place?

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
  •