opacity

Gets or sets the element opacity. Inherited from Element.opacity

Example

<div id="surface" style="width: 250px; height: 250px;"></div>
<script>
    var draw = kendo.drawing;
    var geom = kendo.geometry;

    var rect = new geom.Rect([10, 10], [200, 150]);
    var image = new draw.Image("https://demos.telerik.com/kendo-ui/content/web/editor/tenerife.png", rect);
    
    console.log("Initial opacity:", image.opacity()); // Default is 1
    image.opacity(0.3);
    console.log("New opacity:", image.opacity());

    var surface = draw.Surface.create($("#surface"));
    surface.draw(image);
</script>

Parameters

opacity Number

The element opacity. Ranges from 0 (completely transparent) to 1 (completely opaque).

Returns

Number The current element opacity.

In this article
opacity
Not finding the help you need?
Contact Support