yzt
2023-05-26 2f70f6727314edd84d8ec2bfe3ce832803f1ea77
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Example with postfix (large)
$("input[name='demo1']").TouchSpin({
    min: 0,
    max: 100,
    step: 0.1,
    decimals: 2,
    boostat: 5,
    maxboostedstep: 10,
    postfix: '%',
    buttondown_class: "btn btn-classic btn-primary",
    buttonup_class: "btn btn-classic btn-primary"
});
 
// With prefix
$("input[name='demo2']").TouchSpin({
    min: 0,
    max: 100,
    step: 0.1,
    decimals: 2,
    boostat: 5,
    maxboostedstep: 10,
    prefix: '%',
    buttondown_class: "btn btn-classic btn-primary",
    buttonup_class: "btn btn-classic btn-primary"
});
 
 
// Multiple select boxes
$("input[name='demo_vertical']").TouchSpin({
    verticalbuttons: true,
    buttondown_class: "btn btn-classic btn-info",
    buttonup_class: "btn btn-classic btn-danger"
});
 
 
// Vertical buttons with custom icons
$("input[name='demo_vertical2']").TouchSpin({
    verticalbuttons: true,
    verticalup: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-up"><polyline points="18 15 12 9 6 15"></polyline></svg>',
    verticaldown: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>',
    buttondown_class: "btn btn-classic btn-info",
    buttonup_class: "btn btn-classic btn-danger"
});
 
// Value attribute is not set (applying settings.initval)
$("input[name='demo3_21']").TouchSpin({
    initval: 40,
    buttondown_class: "btn btn-classic btn-primary",
    buttonup_class: "btn btn-classic btn-primary"
});
 
// Button postfix
$("input[name='demo4']").TouchSpin({
    postfix: "Button",
    postfix_extraclass: "btn btn-info",
    buttondown_class: "btn btn-classic btn-primary",
    buttonup_class: "btn btn-classic btn-primary"
});
 
// Change button class
$("input[name='demo6']").TouchSpin({
    buttondown_class: "btn btn-classic btn-danger",
    buttonup_class: "btn btn-classic btn-success"
});