visible
Gets or sets the visibility of the element. Inherited from Element.visible
Example
<div id="surface" style="width: 250px; height: 250px;"></div>
<script>
var draw = kendo.drawing;
var path1 = new draw.Path({
stroke: {
color: "#27ae60",
width: 3
}
})
.moveTo(50, 50)
.lineTo(200, 50);
var path2 = new draw.Path({
stroke: {
color: "#e74c3c",
width: 3
}
})
.moveTo(50, 100)
.lineTo(200, 100);
// Hide the second path using the visible method
path2.visible(false);
console.log("Path1 visible:", path1.visible());
console.log("Path2 visible:", path2.visible());
var surface = draw.Surface.create($("#surface"));
surface.draw(path1);
surface.draw(path2); // This won't be visible
</script>
Parameters
visible Boolean
A flag indicating if the element should be visible.
Returns
Boolean
true if the element is visible; false otherwise.
In this article