Log in

View Full Version : Transparent object in IE



molendijk
07-01-2008, 12:53 PM
Does anyone know how to make <object type="text/html"></object> transparent in IE?
===
Arie Molendijk

Nile
07-01-2008, 01:11 PM
I don't know if this will work:
But try giving it an outer div, and give that div all the opacity(includeing ie's: filter: alpha(opacity=..); ;))
I don't know if it will work, but its work a try.

molendijk
07-01-2008, 01:41 PM
Thanks Nile, but that doesn't work.
I tried everything, including what you suggest, but without luck so far.
===
Arie.

Nile
07-01-2008, 01:47 PM
Can I see your page please?

molendijk
07-01-2008, 02:40 PM
Nile, I don't have a page for that. I'm just wondering why, for this code:
<div style="position:absolute;top:100px">shine through shine through shine through shine through shine through shine through shine through shine through shine through shine through </div>
<object type="text/html" data="http://www.google.com" height="400px" width="400px"></object>the 'shine through-text' does what it says in non-IE, but not in IE. In IE, it does not shine through. But I want it to.
===
Arie.

magicyte
07-01-2008, 06:40 PM
This should do:

<div style="position:absolute;top:100px;">shine through shine through shine through shine through shine through shine through shine through shine through shine through shine through </div>
<object type="text/html" data="http://www.google.com" height="400px" width="400px" style="filter:alpha(opacity=50);opacity:0.5; -moz-opacity:0.5;"></object>
By the way: it is "translucent", not "transparent".

-magicyte

molendijk
07-01-2008, 06:50 PM
Magicyte, I do mean transparent (= clear: can be seen through), not translucent (= allow light to pass through diffusely).
Your code makes the 'shine through-text' itself transludent. It does not make the object (that loads Google) transparent in IE: nothing shines through the object.

Anyhow, thanks,
===
Arie.

magicyte
07-01-2008, 06:59 PM
Well, actually, you can change the number from 50 to 00, 0.5 to 0.0, and 0.5 to 0.0. That WOULD MOST DEFINATELY work and help for u. it makes it completely see-through. INVISIBLE.

-magicyte

molendijk
07-01-2008, 07:17 PM
I see what you mean, but changing the numbers won't make the object less see-through or more see-through in IE.
Arie.

magicyte
07-01-2008, 10:40 PM
What version of IE do you have? That would most definately help.

-magicyte

magicyte
07-01-2008, 10:42 PM
I have IE on my other ME computer. It is version 4.0. The script works perfectly on my internet browser.... Wonder why....

-magicyte

molendijk
07-02-2008, 05:05 PM
I have IE 6.0.
---
Arie.

magicyte
07-03-2008, 03:40 PM
No wonder. In each version there is a differing way to code styles and the appearences. Other than this, I do not know what to do. Try Firefox. It will work there.

-magicyte

jscheuer1
07-03-2008, 04:56 PM
In FF it isn't shining through, it's superimposed upon the object. IE and other browsers have occasionally had elements that acted like this. Selects in IE up to v 7 did this. Opera did it with iframe until rather recently. The object tag isn't really all that widely supported yet, and obviously still has some quirks.

I'm not even aware of what the spec is on something like this, but it doesn't seem all that wrong considering that the Google page has background, and should be able to cover the local text, except that even when I stack it properly, it still doesn't superimpose.

This seems to work, but it is no longer an object tag in IE:


<div style="position:absolute;top:100px">shine through shine through shine through shine through shine through shine through shine through shine through shine through shine through </div>
<!--[if IE]>
<iframe src="http://www.google.com" height="410px" width="400px" frameborder=0></iframe>
<![if !IE]>
<![endif]-->
<object type="text/html" data="http://www.google.com" height="400px" width="400px"></object>
<!--[if IE]>
<![endif]>
<![endif]-->

magicyte
07-03-2008, 05:18 PM
That is very odd. Oh, well. Case closed.

-magicyte

molendijk
07-03-2008, 08:45 PM
In FF it isn't shining through, it's superimposed upon the object.
John, that's a better formulation.
Anyhow, using <iframe> for IE and <object> for non-IE is not an option (for me). If we have to use iframes (thanks, IE), then we might as well use them for non-IE. I' was hoping to have an IE-workaround allowing us to have text etc. to be superimposed upon the object.
===
Arie.

jscheuer1
07-03-2008, 10:41 PM
Well, you have on the one hand what you want, on the other - what will work. Make your own choice. Object is more valid (forward looking) than is iframe, however the actual installed base of browser's support for your code is what you ultimately must deal with. The conditionals could be set differently:


<div style="position:absolute;top:100px">shine through shine through shine through shine through shine through shine through shine through shine through shine through shine through </div>
<!--[if lte IE 7]>
<iframe src="http://www.google.com" height="410px" width="400px" frameborder=0></iframe>
<![if !IE]>
<![endif]-->
<object type="text/html" data="http://www.google.com" height="400px" width="400px"></object>
<!--[if lte IE 7]>
<![endif]>
<![endif]-->

Then assuming I've got that right, and that IE 8, which is supposed to be so compliant, agrees with FF, and Opera on the behavior of the object tag, you would almost have your cake and eat it too. I cannot, however vouch for IE 8 in this regard. It would help to know the specification, even more to test in IE 8.

molendijk
07-04-2008, 09:44 AM
Object is more valid (forward looking) than is iframe
That is indeed the whole reason for what I was looking for.
Thanks,
===
Arie.

jscheuer1
07-04-2008, 05:22 PM
I figured, so my thinking is that you use what works in the older IE, and as IE improves (hopefully with version 8) you no longer rely on the potentially outdated code. Validators will not check what is in the comment blocks and only those versions of IE that you know can handle it will ever even parse it. The best of both worlds.

molendijk
07-04-2008, 05:33 PM
Yes, that seems the best way to tackle the problem.
Thanks John,
---
Arie.