Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: Opacity in Konqueror 3.5.1?

  1. #1
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    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!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

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

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    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.

    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

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

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

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    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!

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    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?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    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

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    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!

  9. #9
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    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.

    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

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    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!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •