Dynamic opacity

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon

    #1

    Dynamic opacity

    In IE I have a routine that dynamically assigns objects' opacity. This works
    fine for some elements but not for others.
    It works for buttons and inputs but not for img, span and select.

    This is the line that sets opacity from a loop through all elements:

    document.forms[0].elements[i].style.filter =
    "progid:DXImage Transform.Micro soft.Alpha(opac ity=" + FadeOpacity + ")";

    Any ideas?

    Thanks IA, Simon


  • Martin Honnen

    #2
    Re: Dynamic opacity



    Simon wrote:
    [color=blue]
    > In IE I have a routine that dynamically assigns objects' opacity. This works
    > fine for some elements but not for others.
    > It works for buttons and inputs but not for img, span and select.
    >
    > This is the line that sets opacity from a loop through all elements:
    >
    > document.forms[0].elements[i].style.filter =
    > "progid:DXImage Transform.Micro soft.Alpha(opac ity=" + FadeOpacity + ")";
    >
    > Any ideas?[/color]

    Have you looked at the documentation on msdn.microsoft. com?
    http://msdn.microsoft.com/library/de...ies/filter.asp
    It clearlys says that "an object must have layout for the filter to
    render". There are ways to achieve that for instance setting height
    and/or width on an element.
    And at the end of the page elements are listed to which filter can be
    applied, the <select> element is not listed.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    Working...