jQuery UI Slider create Event
Last Updated :
23 May, 2022
jQuery UI consists of GUI widgets, visual effects, and themes implemented using HTML, CSS, and jQuery. jQuery UI is great for building UI interfaces for the webpages. jQuery UI provides us a slider control through the slider widget.
The slider widget helps us to get a certain value using a given range. We can change the slider value by sliding. The create event is used to trigger when the slider is created.
The Slider create event accepts two values that are listed below:
- event: It represents the event for the slider widget.
- ui: It is of an object type.
Syntax:
Initialize the slider with the create callback:
$( ".selector" ).slider({
create: function( event, ui ) {}
});
Bind an event listener to the slidecreate event:
$( ".selector" ).on(
"slidecreate",
function( event, ui ) {}
);
CDN Link: First, add jQuery UI scripts needed for your project.
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.12.4.js"></script>
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
Example: This example describes the jQuery UI Slider create Event.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>
jQuery UI Slider create Event
</title>
<link rel="stylesheet" href=
"//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.12.4.js">
</script>
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js">
</script>
<style>
h1 {
color: green;
}
#GFG {
width: 600px;
}
</style>
</head>
<body>
<center>
<h1>GeeksforGeeks</h1>
<h2>jQuery UI Slider create Event</h2>
<div id="GFG"></div>
</center>
<script>
$(function () {
$("#GFG").on('slidecreate', function () {
alert('Slider has been created!');
})
$("#GFG").slider();
});
</script>
</body>
</html>
Output:
Reference: https://api.jqueryui.com/slider/#event-create
Similar Reads
jQuery UI Spinner create Event jQuery UI consists of GUI widgets, visual effects, and themes implemented using jQuery, CSS, and HTML. jQuery UI is great for building UI interfaces for the webpages. jQueryUI spinner widget helps us to increment and decrement values of an input element using up and down arrow. In this article we wi
1 min read
jQuery UI Slider change Event jQuery UI consists of GUI widgets, visual effects, and themes implemented using HTML, CSS, and jQuery. jQuery UI is great for building UI interfaces for the webpages. jQuery UI provides us a slider control through the slider widget. The slider widget helps us to get a certain value using a given ra
2 min read
jQuery UI Menu create Event jQuery UI consists of GUI widgets, visual effects, and themes implemented using HTML, CSS, and jQuery. It is great for building UI interfaces for the webpages. The jQuery UI Menu widget creates a menu list that is used for mouse and keyboard interactions. The jQuery UI Menu creates event triggers wh
2 min read
jQuery UI Tabs create Event jQuery UI consists of GUI widgets, visual effects, and themes implemented using HTML, CSS, and jQuery. jQuery UI is great for building UI interfaces for the webpages. The jQuery UI Tabs widget is used to create a single content area with multiple panels that are associated with a header in a list. T
3 min read
jQuery Mobile Slider create Event jQuery Mobile is a web-based technology used to make responsive content that can be accessed on all smartphones, tablets, and desktops. In this article, we will be using the jQuery Mobile Slider create event that is triggered when the slider is created. Callback Parameter: The callback function acce
2 min read