title | page_title | description |
---|---|---|
Popup |
Configuration, methods and events of Kendo UI Popup |
Easy to follow steps guide how to quickly configure Popup UI widget. |
Represents the Kendo UI Popup widget. Inherits from Widget.
Configures the opening and closing animations of the popup. Setting the animation
option to false
will disable the opening and closing animations. As a result the popup will open and close instantly.
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup({
animation: false
});
</script>
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup({
animation: {
close: {
effects: "fadeOut zoom:out",
duration: 300
},
open: {
effects: "fadeIn zoom:in",
duration: 300
}
}
});
</script>
The animation played when the popup is closed.
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup({
animation: {
close: {
effects: "zoom:out",
duration: 300
}
}
});
</script>
The effect(s) to use when playing the close animation. Multiple effects should be separated with a space.
Complete list of available animations
The duration of the close animation in milliseconds.
The animation played when the calendar popup is opened.
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup({
animation: {
open: {
effects: "zoom:in",
duration: 300
}
}
});
</script>
The effect(s) to use when playing the open animation. Multiple effects should be separated with a space.
Complete list of available animations
The duration of the open animation in milliseconds.
Specifies the element that will be used as an anchor. The widget will open next to that element.
<input id="datepicker" />
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup({
anchor: $("#datepicker")
});
</script>
Which element the popup will be appended to.
<input id="datepicker" />
<div id="container"></div>
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup({
anchor: $("#datepicker"),
appendTo: $("#container")
});
</script>
Specifies how to position the popup element based on achor point. The value is space separated "y" plus "x" position.
The available "y" positions are:
- "bottom"
- "center"
- "top"
The available "x" positions are:
- "left"
- "center"
- "right"
<input id="datepicker" />
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup({
anchor: $("#datepicker"),
origin: "top left"
});
</script>
Specifies which point of the popup element to attach to the anchor's origin point. The value is space separated "y" plus "x" position.
The available "y" positions are:
- "bottom"
- "center"
- "top"
The available "x" positions are:
- "left"
- "center"
- "right"
<input id="datepicker" />
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup({
anchor: $("#datepicker"),
position: "bottom left"
});
</script>
Closes the popup.
<div id="popup">CONTENT</div>
<button id="close">Close</button>
<script>
$("#popup").kendoPopup();
var popup = $("#popup").data("kendoPopup");
popup.open();
$("#close").click(function() {
popup.close();
});
</script>
Opens the popup.
<div id="popup">CONTENT</div>
<button id="open">Open</button>
<script>
$("#popup").kendoPopup();
var popup = $("#popup").data("kendoPopup");
$("#open").click(function() {
popup.open();
});
</script>
Re-positions the popup element
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup();
var popup = $("#popup").data("kendoPopup");
popup.position();
</script>
Changes the initial Popup configuration.
The new configuration options.
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup();
var popup = $("#popup").data("kendoPopup");
popup.setOptions({
origin: "top left"
position: "bottom left"
});
</script>
Checks whether the popup is visible
Boolean
True when the popup is visible
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup();
var popup = $("#popup").data("kendoPopup");
alert(popup.visible());
</script>
Fires when the popup is opened
The widget instance which fired the event.
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup({
activate: function(e) {
e.preventDefault(); //prevent popup closing
}
});
</script>
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup();
var popup = $("#popup").data("kendoPopup");
popup.bind("activate", function(e) {
e.preventDefault(); //prevent popup closing
});
</script>
Fires when the popup closes
The widget instance which fired the event.
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup({
close: function(e) {
e.preventDefault(); //prevent popup closing
}
});
</script>
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup();
var popup = $("#popup").data("kendoPopup");
popup.bind("close", function(e) {
e.preventDefault(); //prevent popup closing
});
</script>
Fires when the popup is closed
The widget instance which fired the event.
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup({
deactivate: function(e) {
e.preventDefault(); //prevent popup closing
}
});
</script>
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup();
var popup = $("#popup").data("kendoPopup");
popup.bind("deactivate", function(e) {
e.preventDefault(); //prevent popup closing
});
</script>
Fires when the popup opens
The widget instance which fired the event.
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup({
open: function(e) {
e.preventDefault(); //prevent popup closing
}
});
</script>
<div id="popup">CONTENT</div>
<script>
$("#popup").kendoPopup();
var popup = $("#popup").data("kendoPopup");
popup.bind("open", function(e) {
e.preventDefault(); //prevent popup closing
});
</script>