jQuery UI 由 GUI 小部件、視覺效果和使用 HTML、CSS 和 jQuery 實現的主題組成。 jQuery UI 非常適合為網頁構建 UI 接口。 jQuery UI 按鈕集小部件用於為一組相關按鈕提供視覺分組。
jQuery UI 按鈕集 refresh() 方法用於刷新按鈕集小部件。
用法:
$( ".selector" ).buttonset( "refresh" );
參數:此方法不接受任何參數。
返回值:此方法不返回任何值。
CDN鏈接:首先,添加項目所需的jQuery UI腳本。
<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>
例:這個例子演示了 jQuery UI buttonset refresh() 方法。
HTML
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<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>
</head>
<body>
<center>
<h1 style="color:green;">
GeeksforGeeks
</h1>
<h3>jQuery UI Buttonset refresh() Method</h3>
<form>
<fieldset>
<legend>Button_Set</legend>
<div id="ButtonSet_Radio">
<input id="Company" type="radio"
checked="checked">
<label for="Company">GeeksforGeeks</label>
<input id="Department" type="radio">
<label for="Department">Computer Science</label>
</div>
</fieldset>
</form>
<input type="button" id="Button_for_refresh"
style="padding:5px 15px; margin-top:40px;"
value="Refresh the widget">
<div id="log"></div>
</center>
<script>
$(document).ready(function () {
$("#ButtonSet_Radio").buttonset();
$("#Button_for_refresh").on('click', function () {
$("#ButtonSet_Radio").buttonset("refresh");
});
});
</script>
</body>
</html>
輸出:
參考: https://api.jqueryui.com/buttonset/#method-refresh
相關用法
- jQuery UI Buttonset destroy()用法及代碼示例
- jQuery UI Buttonset disable()用法及代碼示例
- jQuery UI Buttonset enable()用法及代碼示例
- jQuery UI Buttonset widget()用法及代碼示例
- jQuery UI Buttonset option()用法及代碼示例
- jQuery UI Buttonset items用法及代碼示例
- jQuery UI Buttonset disabled用法及代碼示例
- jQuery UI Buttonset create用法及代碼示例
- jQuery Mobile Flipswitch refresh()用法及代碼示例
- jQuery Mobile Listview refresh()用法及代碼示例
- jQuery Mobile Slider refresh()用法及代碼示例
- jQuery UI Accordion refresh()用法及代碼示例
- jQuery UI Button refresh()用法及代碼示例
- jQuery UI Datepicker refresh()用法及代碼示例
- jQuery Mobile Rangeslider refresh()用法及代碼示例
- jQuery Mobile Toolbar refresh()用法及代碼示例
- jQuery Mobile Selectmenu refresh()用法及代碼示例
- jQuery Mobile Collapsibleset refresh()用法及代碼示例
- jQuery UI Sortable refresh()用法及代碼示例
- jQuery UI Selectable refresh()用法及代碼示例
- jQWidgets jqxBarGauge refresh()用法及代碼示例
注:本文由純淨天空篩選整理自Kanchan_Ray大神的英文原創作品 jQuery UI Buttonset refresh() Method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。