Partager via


opacity Attribute | Opacity Property

Sets or retrieves the opacity level that is applied to the content of an object.

Syntax

HTML
{ filter:progid:DXImageTransform.Microsoft.BasicImage(
    opacity = fOpacity ... ) ... }
Scripting
object.filters.item(
    "DXImageTransform.Microsoft.BasicImage").Opacity [ = fOpacity ]

Possible Values

fOpacity Floating-point that specifies or receives the opacity level. The value can range from 0.0 to 1.0.
0.0
Transparent.
1.0
Default. Opaque.

The property is read/write. The property has a default value of 1.0.

Example

This sample exposes an image's background text using the Opacity property of the BasicImage filter.

<!-- This DIV is the target container for an image.  -->        
    <DIV ID="oDiv" STYLE="position:absolute; left:270px;" >
        An Image - >    
        <IMG SRC='/workshop/graphics/earglobe.gif' />
    </DIV>
<BUTTON onclick="oDiv.style.filter=
        'progid:DXImageTransform.Microsoft.BasicImage(opacity=.2)'">
    Opaque</BUTTON><BR/>
<BUTTON onclick="oDiv.style.filter=''">Clear Filter</BUTTON> 
Click the Opaque button, and the text can be seen through the opaque DIV element.

Applies To

BasicImage