Whatever I set .style.opacity to in Konqueror 3.5.1, it displays the element at full opacity, and trying to get .style.opacity always returns 0.
Is this a Konqueror bug? Does it apply to Safari as well? Is there a way around it?
Whatever I set .style.opacity to in Konqueror 3.5.1, it displays the element at full opacity, and trying to get .style.opacity always returns 0.
Is this a Konqueror bug? Does it apply to Safari as well? Is there a way around it?
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
I thought Konq used -KHTML-opacity. Somebody must. Safari (at least according to folks who use it that I have helped with the Ultimate Fade script) does respond to generic opacity, much in the same way (if not identically) as FF now does.
Back to Konq. Generally, if you set a property/value pair in a browser that doesn't support it, you can get any sort of return value when you query it later.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
According to (slightly outdated) Konqueror documentation, the opacity property isn't supported.Originally Posted by Twey
Safari apparently does support opacity, though I can't confirm that. You might find better support by also using the -khtml-opacity property.Does it apply to Safari as well? Is there a way around it?
Don't forget that Safari is based on the KHTML engine.Originally Posted by jscheuer1
Mike
I'm not forgetting that and, in fact earlier version may require -khtml-opacity, something I should have mentioned. But real world, recent versions don't, but do support generic opacity, at least as relayed to me in tests and other work I've done in concert with Safari users.Originally Posted by mwinter
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Slightly outdated? That documentation is from 3.4; there've been some very major changes since then. 3.5.1, at least, uses W3C opacity instead; in fact, -khtml-opacity is no longer recognised (element.style.KhtmlOpacity is undefined, but element.style.opacity isn't).Originally Posted by Mike
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Is that with or without having previously defined these via script and/or style?Originally Posted by Twey
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Your first post seemed to suggest otherwise, but a second reading shows a typo that I didn't notice before. You state that you set the opacity property to something, but you don't say what.Originally Posted by Twey
I must have subconsciously glossed over that mistake: I read that assigning any value always makes the element opaque, but reading the value returns zero.
Mike
I said "anything"Originally Posted by Mike
Examples (consecutively executed, on a document with images):Code:window.alert(typeof document.images[0].style.opacity); // string window.alert(document.images[0].style.opacity); // empty string window.alert(typeof document.images[0].style.KhtmlOpacity); // undefined window.alert(document.images[0].style.opacity = 0.5); // 0.5, but image remains totally opaque window.alert(document.images[0].style.opacity); // 0
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
I know. I read the post again as the thread was loading.Originally Posted by Twey
So, I was right the first time.
I noticed a long time ago that Konqueror implements the getComputedStyle method of the defaultView property of the document object. However, calling that method always returns null, irrespective of the arguments passed to it. Safari, on the other hand, omits the method altogether.
This may be a pattern that the Konqueror developers have decided to implement. To provide all of the properties of a particular interface, regardless of whether they're actually functional. I can't think of any other rational explanation, though if that is the approach they've decided to take, it's a rather stupid one.
Out of curiosity, can you alter the opacity of any element using any method (CSS rules or the DOM) in the latest Konqueror? If not, then it would seem that the 3.4 documentation isn't that out-of-date at all.
Finally, are you sure that's the correct capitalisation for the property? Doeswindow.alert(typeof document.images[0].style.KhtmlOpacity); // undefined
display 'undefined' as well? Just a thought...Code:alert(typeof document.images[0].style.getPropertyValue('-khtml-opacity'));
Mike
It returns a string. However, so does... so I'm not going to put much store by that.Code:window.alert(typeof document.images[0].style.getPropertyValue("Mr. Fish"));
Yes, including <script> elements.Originally Posted by Mike
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Bookmarks