visibility:hidden issue on IE

2,164 views
Skip to first unread message

Umesh Chandak

unread,
Apr 9, 2012, 2:13:30 PM4/9/12
to firebre...@googlegroups.com
Hi ,
I have observed that when we set visibility:hidden on plugin object in IE, we does not receive the AttachedEvent on plugin object window.

This issue is happening only on IE and not observed on Firefox and Chrome.

Are there any guideline for setting css attribute visibility:hidden on the plugin object in IE ?
 

Tadeusz Kozak

unread,
Apr 9, 2012, 2:40:59 PM4/9/12
to firebre...@googlegroups.com, firebre...@googlegroups.com
Hi,

I'm using jQuery.hide()/jQuery.show(), which is equal to toggle between display block and none;

--
Tadeusz Kozak
http://about.me/tkozak

Sent from Mobile device, sorry for any typos and brevity.

Richard Bateman

unread,
Apr 9, 2012, 3:21:30 PM4/9/12
to firebre...@googlegroups.com

There is indeed a guideline:

"Don't do it."

It's totally up to you, of course, but you'll find that it causes all sorts of annoying issues if you do; among other things is that your AttachedEvent may not get called until you make it visible, and then when you make it invisible again you're likely to get a DetachedEvent. What it comes down to is that if you want to safe yourself a lot of hassle and weird bugs in different browsers then I recommend you never hide it using the visibility: hidden css rule. display:none actually has many of the same issues on some (other) browsers, so I wouldn't do that either.

What I recommend for hiding it is to put the object tag (don't use embed tags, those are even worse) sized 100%x100% in a div and then resize that div to 1x1 pixels when you want it hidden. Some call this extreme, but that's the only solution I've found that doesn't require lots of hackery in the plugin to make it work correctly and seems to work universally in all browsers.

Richard

Randy Girard

unread,
Apr 9, 2012, 5:46:55 PM4/9/12
to firebre...@googlegroups.com
Does setting the opacity to 0% have any known side affects?

Perhaps you could also statically position the div, and use z-index to
hide it further...


Just some random ideas.


--
Randy Girard
Ernie Ball, Inc.
I.T. Department

NOTICE: This e-mail is for the sole use of the intended recipient(s).
Any unauthorized review, use, disclosure or distribution of this
e-mail or its contents is strictly prohibited. If you are not the
intended recipient, please contact the sender by reply mail and
destroy the original and all copies of the original message.

Tadeusz Kozak

unread,
Apr 10, 2012, 3:51:40 AM4/10/12
to firebre...@googlegroups.com
Hi Guys,

I haven't found any issues yet with the display:none, thx for tip Richard, I'll have to dig it further.

If display:none is a bad idea, I'd suggest using CSS like:
.object-hidden {
position:fixed;
left: -1000px;
top: -1000px;
}

z-index doesn't work with windowed plugins at all. We have to use iframe to display anything above the object tags. Haven't tested the opacity tough.

Regards,
Ted

2012/4/9 Randy Girard <ran...@ernieball.com>

Richard Bateman

unread,
Apr 10, 2012, 12:08:18 PM4/10/12
to firebre...@googlegroups.com

That might work on a windowless plugin; windowed plugins don't support opacity or z-index.

Richard

Reply all
Reply to author
Forward
0 new messages