This week's book giveaway is in the Web Services forum.
We're giving away four copies of Microservices in Action and have Morgan Bruce & Paulo A. Pereira on-line!
See this thread for details.
Win a copy of Microservices in Action this week in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

making an IFRAME disappear through javascript  RSS feed

 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

I'm running into a problem that is apparently well-known, except to me, and of course it's very late in the game.

We have a certain set of users of our website that are very important. They number in the 1's. And they use IE 5.1 on a MAC platform.

We have a javascript drop-down menu that is experiencing the dreaded IFRAME z-index trouble. The menu drops down and disappears behind the iframe. This is not a problem with any other browser/platform combo (aside from NS4.7, which doesn't even do iframes).

There was a hint of a solution somewhere that took a cue from the selectbox problem (hide the selectbox) and it claimed that I could hide the iframe when the menu dropped down. The problem is, it did this for ALL browsers, and it actually only hid the *contents* of the IFRAME and not the IFRAME itself.

So.. javascript wizards, I need some help!

Is it possible to hide an entire iframe? I've seen vague hints about using ilayers. This is all archane magic to me, and I've got a whole other list of things to do today, so I'm going to set my line here and hopefully have a nibble.

Why do people leave 'huge changes' until 2 days before the 'drop dead' line???
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh yes, we're using this menu...

http://www.dhtmlcentral.com/projects/coolmenus/?m=10

And here is the code that hides the 'contents' of the iframe... I've modified it to exclude IE6 (I'd exclude IE5 on Windows, but I'm not sure how to do this).
 
Marshal
Posts: 67164
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What mechanism are you using to hide the iframe that's only hiding the content? (Or did you show that and I missed it?)
I don't have a Mac handy at the moment to test it, but my first tactic would be to set a style of display:none or visibility:hidden on the iframe (depending on what effect you want when hidden). Is that what you tried?
hth,
bear
[ August 08, 2003: Message edited by: Bear Bibeault ]
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the mechanism is the code posted above.

It's supposed to be appended on to the end of the menu's javascript file. That file is much too long to post, but available from the dhtmlcentral site I linked in the second post.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, thanks for the pointer bear.

I've scrubbed out all the unnecessary positional math tricks from the above code. We always want to hide the iframe, because our menu will *always* disappear under it.

I've got the frame to hide itself, but I can't seem to get it to unhide...

Can anyone see anything in the code below that is obviously wrong?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I posted something in the MO. I will look into it more later.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For this particular javascript menu (coolmenu) this appears to do the trick:
iwrap is the id of the iframe i'm trying to hide.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!