View Full Version : IFRAME needs some adjustments
bill.onthebeach
04-15-2010, 05:26 PM
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
djr33
04-15-2010, 05:53 PM
<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>
bill.onthebeach
04-15-2010, 06:13 PM
<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
djr33
04-15-2010, 06:25 PM
Add it to the link tags (<a>), not the iframe tag. You modify the code OF the iframe page, not of the main page.
bill.onthebeach
04-15-2010, 06:37 PM
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!
djr33
04-15-2010, 06:49 PM
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.
bill.onthebeach
04-15-2010, 07:07 PM
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!
djr33
04-15-2010, 09:56 PM
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).
BLiZZaRD
04-15-2010, 09:56 PM
Link to the page.
akitodito
04-24-2010, 06:10 PM
I cleaned up the html but the iframe still moves around. is there a way to make it stay in one place?
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.