Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

iframe display property problem

Status
Not open for further replies.

blackbeltjones

Technical User
May 20, 2004
6
GB
Hi, I have a free forum that's getting kinda popluar at the moment and I have desinged the layout and added various scripts for the users. Being that it's a free forum, it obviously has ad banners. I got rid of them (hid them) because quite frankly, they were just plain ugly and were spoiling everthing we were trying to create- A proffessional looking forum. So once I had gotten rid of that ad banner with a very simple script:

<style>
iframe{display: none;}
</style>

...I found that another iframe we have on the same page (a tag board) was also disabled by the same "display: none" command.

Is there anyway or any code I can use so that I can still prevent the first iframe from displaying, yet allow the second (the tag board) to display and function normally?

I've read this page thoroughly, but to no avail:


Any help or advice would be greatly appreciated. Thanks.
 
you could try an' see if there's any `id` provided.
<iframe id=lala></iframe>
when there is, you should see if the add iframe has such a name.
If so (add has id):
iframe#lala {display:none}

if not (add hasn't but tagboard has):
iframe { display:none }
iframe#tagboardid {display:block}
in that order.

 
Thanks lumberjakel,

I tired this

iframe.myiframe {
display:block;
}

and called the iframe 'myiframe' and it didn't seem to work for some reason. I think your way is much better, I'll go and try that now. Thanks alot! Pz
 
u could also think about javascript...

document.getElementById("myiframe").style.display="none"

Known is handfull, Unknown is worldfull
 
As lumberjakel says:
Code:
[i][COLOR=grey]code for your iframe:[/color][/i]
<iframe id="myiframe"

[COLOR=grey][i]css code:[/i][/color]
iframe {display: none;}
iframe#myiframe {display: block;}

I tired this
iframe.myiframe {
display:block;
}
and called the iframe 'myiframe'...

for "iframe.myiframe" to work, you need to give your iframe a class in your html:
e.g. [tt]<iframe class="myiframe"...[/tt]

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top