-2
我正在使用updown number plugin 現在我想要在初始化對象後更改min
和max
。在創建文檔之後重新創建js對象
我希望用戶可以選擇他們選擇這個對象必須改變,但不工作
請幫幫我,
我爲我的軟弱Englthish
抱歉,這是我的代碼:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://nakupanda.github.io/number-updown/assets/number-updown/js/updown.js"></script>
<script src="http://nakupanda.github.io/number-updown/assets/prettify/run_prettify.js"></script>
<script src="http://nakupanda.github.io/number-updown/assets/bootstrap/js/bootstrap.min.js"></script>
<link href="http://nakupanda.github.io/number-updown/assets/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
<meta charset="utf-8" />
<title>jQuery number-updown plugin examples</title>
<style>
.demo-input {
width: 200px;
}
</style>
</head>
<body style="padding-bottom: 100px;">
<div class="container">
<button id="new-min-max">new min/max</button>
<h3>Controlled by buttons</h3>
<div class="demo">
<div style="display: inline-block"><input type="text" class="form-control demo-input" id="controlledByButtons" value="0" /></div>
<div style="display: inline-block">
<button class="btn btn-default" id="btnIncrease">+</button>
<button class="btn btn-default" id="btnDecrease">-</button>
</div>
</div>
</div>
<script type="text/javascript">
var $controlledByButtons = $('#controlledByButtons');
$controlledByButtons.updown({
step: 10,
shiftStep: 100
});
var $updown = $controlledByButtons.data('updown');
$('#btnIncrease').click(function(event){
$updown.increase(event);
$updown.triggerEvents();
});
$('#btnDecrease').click(function(event){
$updown.decrease(event);
$updown.triggerEvents();
});
$("#new-min-max").click(function(){
//what comes here to change min and max again????
});
</script>
</body>
</html>
你可以發佈你的代碼嗎? – liontass
@liontass我寫了我的代碼。請現在幫助我 –