Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 espaco 1
var ComponentsIonSliders = function () {
2
 
3
    return {
4
        //main function to initiate the module
5
        init: function () {
6
 
7
            $("#range_1").ionRangeSlider({
8
                min: 0,
9
                max: 5000,
10
                from: 1000,
11
                to: 4000,
12
                type: 'double',
13
                step: 1,
14
                prefix: "$",
15
                prettify: false,
16
                hasGrid: true
17
            });
18
 
19
            $("#range_2").ionRangeSlider();
20
 
21
            $("#range_5").ionRangeSlider({
22
                min: 0,
23
                max: 10,
24
                type: 'single',
25
                step: 0.1,
26
                postfix: " mm",
27
                prettify: false,
28
                hasGrid: true
29
            });
30
 
31
            $("#range_6").ionRangeSlider({
32
                min: -50,
33
                max: 50,
34
                from: 0,
35
                type: 'single',
36
                step: 1,
37
                postfix: "°",
38
                prettify: false,
39
                hasGrid: true
40
            });
41
 
42
            $("#range_4").ionRangeSlider({
43
                type: "single",
44
                step: 100,
45
                postfix: " light years",
46
                from: 55000,
47
                hideText: true
48
            });
49
 
50
            $("#range_3").ionRangeSlider({
51
                type: "double",
52
                postfix: " miles",
53
                step: 10000,
54
                from: 25000000,
55
                to: 35000000,
56
                onChange: function(obj){
57
                    var t = "";
58
                    for(var prop in obj) {
59
                        t += prop + ": " + obj[prop] + "\r\n";
60
                    }
61
                    $("#result").html(t);
62
                }
63
            });
64
 
65
            $("#updateLast").on("click", function(){
66
 
67
                $("#range_3").ionRangeSlider("update", {
68
                    min: Math.round(10000 + Math.random() * 40000),
69
                    max: Math.round(200000 + Math.random() * 100000),
70
                    step: 1,
71
                    from: Math.round(40000 + Math.random() * 40000),
72
                    to: Math.round(150000 + Math.random() * 80000)
73
                });
74
 
75
            });
76
 
77
        }
78
 
79
    };
80
 
81
}();