visible
Gets or sets the visibility of the element. Inherited from Element.visible
Parameters
visible Boolean
A flag indicating if the element should be visible.
Returns
Boolean
true if the element is visible; false otherwise.
Example
<div id="surface"></div>
<script>
var draw = kendo.drawing;
var geom = kendo.geometry;
var circleGeometry = new geom.Circle([100, 100], 30);
var circle = new draw.Circle(circleGeometry)
.stroke("maroon", 2)
.fill("mistyrose");
var surface = draw.Surface.create($("#surface"));
surface.draw(circle);
// Check initial visibility
console.log("Initial visibility:", circle.visible());
// Toggle visibility every 2 seconds
setInterval(() => {
var currentVisibility = circle.visible();
circle.visible(!currentVisibility);
console.log("Visibility changed to:", circle.visible());
}, 2000);
</script>
In this article