http://jqueryui.com/demos/——UI Demos
1)下载自己需要的组件http://jqueryui.com/download/
2)选择主题
3)选择jQuery UI版本
4)点击下载
需要引用下载的ui文件库
<link rel="stylesheet" href="jquery-ui.min.css">
<script src="external/jquery/jquery.js"></script>
<script src="jquery-ui.min.js"></script>
完整小示例:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery UI</title>
<link rel="stylesheet" href="jquery-ui-1.12.1/jquery-ui.min.css">
</head>
<body>
<input type="text" name="date" id="date">
</body>
<script src="jquery-ui-1.12.1/external/jquery/jquery.js"></script>
<script src="jquery-ui-1.12.1/jquery-ui.min.js"></script>
<script>
$("#date").datepicker();
</script>
</html>
使用一个或多个选项改变默认配置:
$( "#mySliderDiv" ).slider({
orientation: "vertical",
min: 0,
max: 150,
value: 50
});
API :http://jqueryui.com/demos/
4.Visual Customization:Desiging a jQuery UI Theme 定制自己的主题
$( "#elem" ).progressbar();
$( "#elem" ).progressbar({ value: 20 });
$( "#elem" ).progressbar( "value" );
$( "#elem" ).progressbar( "value", 40 );
$( "#elem" )
.progressbar( "value", 90 )
.addClass( "almost-done" );
1)option
把"option"设置为第一个参数
$( "#elem" ).progressbar( "option", "value", 30 );//设置当前选项
$( "#elem" ).progressbar( "option", "value" );//获取当前选项
$( "#elem" ).progressbar( "option", {//改变多个选项
value: 100,
disabled: true
});
2)disable
$( "#elem" ).progressbar( "disable" );
3)enable
$( "#elem" ).progressbar( "enable" );
4)destroy
$( "#elem" ).progressbar( "destroy" );
5)widget
$( "#elem" ).progressbar( "widget" );
$( "#elem" ).bind( "progressbarchange", function() {
alert( "The value has changed!" );
});
$( "#elem" ).progressbar({
change: function() {
alert( "The value has changed!" );
}
});
jQuery UI CSS Framework====http://api.jqueryui.com/theming/css-framework/
1.Download a ThemeRoller theme
2.Modify the CSS files
3.Write completely custom CSS
四、Widget Factory