$( "#spinner" ).spinner( "option", "culture", $( this ).val() );如何理解
<!doctype html>
<html>
<head>
? <meta charset="utf-8">
? <title>jQuery UI 旋轉器(Spinner) - 貨幣</title>
? <link rel="stylesheet" >
? <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
? <script src="/static/js/jqueryui/resources/demos/external/jquery.mousewheel.js"></script>
? <script src="/static/js/jqueryui/resources/demos/external/globalize.js"></script>
? <script src="/static/js/jqueryui/resources/demos/external/globalize.culture.de-DE.js"></script>
? <script src="/static/js/jqueryui/resources/demos/external/globalize.culture.ja-JP.js"></script>
? <script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
? <link rel="stylesheet" >
? <script>
? $(function() {
??? $( "#currency" ).change(function() {
????? $( "#spinner" ).spinner( "option", "culture", $( this ).val() );
??? });
?
??? $( "#spinner" ).spinner({
????? min: 5,
????? max: 2500,
????? step: 25,
????? start: 1000,
????? numberFormat: "C"
??? });
? });
? </script>
</head>
<body>
?
<p>
? <label for="currency">要捐款的貨幣</label>
? <select id="currency" name="currency">
??? <option value="en-US">US $</option>
??? <option value="de-DE">EUR €</option>
??? <option value="ja-JP">YEN ¥</option>
? </select>
</p>
<p>
? <label for="spinner">要捐款的數量:</label>
? <input id="spinner" name="spinner" value="5">
</p>
</body>
</html>
2018-07-15
id為spinner的input組件的初始值,可以通過組件的上下箭頭加減值