Go Back   Dynamic Drive Forums > General Coding > CSS
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #1  
Old 03-06-2006, 08:30 PM
Twey's Avatar
Twey Twey is offline
Modtoreador
 
Join Date: Jun 2005
Location: 英国
Posts: 11,933
Thanks: 1
Thanked 180 Times in 172 Posts
Blog Entries: 2
Default Opacity in Konqueror 3.5.1?

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!
Reply With Quote
  #2  
Old 03-06-2006, 09:46 PM
jscheuer1's Avatar
jscheuer1 jscheuer1 is offline
No Kidding?
 
Join Date: Mar 2005
Location: SE PA USA
Posts: 19,000
Thanks: 19
Thanked 1,135 Times in 1,121 Posts
Blog Entries: 3
Default

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.
__________________
WWWWWWWWWWWW
- John
________________________

Really Show Your Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Reply With Quote
  #3  
Old 03-06-2006, 09:51 PM
mwinter mwinter is offline
Elite Coders
 
Join Date: Dec 2004
Location: UK
Posts: 2,361
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Twey
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.
According to (slightly outdated) Konqueror documentation, the opacity property isn't supported.

Quote:
Does it apply to Safari as well? Is there a way around it?
Safari apparently does support opacity, though I can't confirm that. You might find better support by also using the -khtml-opacity property.


Quote:
Originally Posted by jscheuer1
I thought Konq used -KHTML-opacity. Somebody must.
Don't forget that Safari is based on the KHTML engine.

Mike
Reply With Quote
  #4  
Old 03-06-2006, 10:27 PM
jscheuer1's Avatar
jscheuer1 jscheuer1 is offline
No Kidding?
 
Join Date: Mar 2005
Location: SE PA USA
Posts: 19,000
Thanks: 19
Thanked 1,135 Times in 1,121 Posts
Blog Entries: 3
Default

Quote:
Originally Posted by mwinter
Don't forget that Safari is based on the KHTML engine.
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.
__________________
WWWWWWWWWWWW
- John
________________________

Really Show Your Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Reply With Quote
  #5  
Old 03-07-2006, 04:48 PM
Twey's Avatar
Twey Twey is offline
Modtoreador
 
Join Date: Jun 2005
Location: 英国
Posts: 11,933
Thanks: 1
Thanked 180 Times in 172 Posts
Blog Entries: 2
Default

Quote:
Originally Posted by Mike
According to (slightly outdated) Konqueror documentation, the opacity property isn't supported.
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).
__________________
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!
Reply With Quote
  #6  
Old 03-07-2006, 05:17 PM
jscheuer1's Avatar
jscheuer1 jscheuer1 is offline
No Kidding?
 
Join Date: Mar 2005
Location: SE PA USA
Posts: 19,000
Thanks: 19
Thanked 1,135 Times in 1,121 Posts
Blog Entries: 3
Default

Quote:
Originally Posted by Twey
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).
Is that with or without having previously defined these via script and/or style?
__________________
WWWWWWWWWWWW
- John
________________________

Really Show Your Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Reply With Quote
  #7  
Old 03-07-2006, 07:02 PM
mwinter mwinter is offline
Elite Coders
 
Join Date: Dec 2004
Location: UK
Posts: 2,361
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Twey
3.5.1, at least, uses W3C opacity instead
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.

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
Reply With Quote
  #8  
Old 03-07-2006, 07:22 PM
Twey's Avatar
Twey Twey is offline
Modtoreador
 
Join Date: Jun 2005
Location: 英国
Posts: 11,933
Thanks: 1
Thanked 180 Times in 172 Posts
Blog Entries: 2
Default

Quote:
Originally Posted by Mike
You state that you set the opacity property to something, but you don't say what.
I said "anything"
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!
Reply With Quote
  #9  
Old 03-07-2006, 07:58 PM
mwinter mwinter is offline
Elite Coders
 
Join Date: Dec 2004
Location: UK
Posts: 2,361
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Twey
I said "anything"
I know. I read the post again as the thread was loading. 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.

Quote:
window.alert(typeof document.images[0].style.KhtmlOpacity); // undefined
Finally, are you sure that's the correct capitalisation for the property? Does

Code:
alert(typeof document.images[0].style.getPropertyValue('-khtml-opacity'));
display 'undefined' as well? Just a thought...

Mike
Reply With Quote
  #10  
Old 03-07-2006, 08:07 PM
Twey's Avatar
Twey Twey is offline
Modtoreador
 
Join Date: Jun 2005
Location: 英国
Posts: 11,933
Thanks: 1
Thanked 180 Times in 172 Posts
Blog Entries: 2
Default

It returns a string. However, so does
Code:
window.alert(typeof document.images[0].style.getPropertyValue("Mr. Fish"));
... so I'm not going to put much store by that.
Quote:
Originally Posted by Mike
can you alter the opacity of any element using any method (CSS rules or the DOM) in the latest Konqueror?
Yes, including <script> elements.
__________________
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!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:02 AM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.