Hello all, I have 2 questions related to IFrame element:
<iframe src="?????" allowtransparency="true" name="myframe" width="633" height="476" frameborder="0"></iframe>
1. allowtransparency="true" works only for Mozilla, how can I get transparent iframe in IE, Opera, etc..?
2. what should be instead of ????? in src="?????" if I want to keep the same page after refresh? In other words when I refresh, the page becomes blank.
Thanks a lot
taken from another webforum
as far as the iframe src=
I found it..
The solution is this:
1. First Give your iframe the allowtransparency="true" tag.
2. Make sure the source page's content has NO background color specified... not in the page itself, and not in any stylesheet linked to the page! This will make the body color pure white.
3. Add this to your iframe tag:
Step 1 and 2 makes the iframe transparent in netscape/mozilla/firefox. As long as the page has no other background specified, the transparency works... but if you specify a background color, the transparency is lost.
Step 3 makes it work in Internet explorer, ie's filter:chroma nukes the white background. That means you must make sure no other part of your page (or at least nothing in that iframe) has pure white, or it will be made invisible. That's pretty easy, if something is even slightly differently colored (for example #FFFFFD) then it won't be transparent.
So the example code:
<iframe src="anything.htm" frameborder="No" style="FILTER: chroma(color=#FFFFFF)" allowtransparency="true">
And "anything.htm" must not have any bgcolor specified in its body tag, or in a style section, or in any CSS that it's linked to.
Hope this was helpful to someone other than me.
that src is the link to the page you are referencing eg, src="http://www.google.com" or http:www.yourwebsite.com/filename.html"
Thank you sooo much it worked, you are the best
Sorry but perhaps you could know the solution to my second question, that is when I refresh the page, current page becomes blank.
Don't know if this is any help, but here is a small page on iFrame navigation menus, or how to make a mini-browser using an iFrame...
Hope this helps.
i have used a refresh in this instance
i used that code on the page that is being used in the iframe, not on the parent document. 10 seconds is far too fast in your case, but you can edit that, the code is to be placed in your <head>
// The time out value is set to be 10,000 milli-seconds (or 10 seconds)
setTimeout(' document.location=document.location' ,10000);
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)