var s1 = new Slider({
$target: '#slider1',
orientation: 'horizontal'
});
var s2 = new Slider({
$target: '#slider2',
orientation: 'vertical'
});
var s3 = new Slider({
$target: '#slider3',
orientation: 'horizontal',
min: 0,
max: 300,
value: 20
});
var s4 = new Slider({
$target: '#slider4',
orientation: 'horizontal',
step: 10
});
var s5 = new Slider({
$target: '#slider5',
orientation: 'horizontal',
value: 20,
type: 'min'
});
var s6 = new Slider({
$target: '#slider6',
orientation: 'horizontal',
value: 20,
type: 'max'
});
var s7 = new Slider({
$target: '#slider7',
orientation: 'horizontal',
value: 20,
type: 'min',
readOnly: true
});
var s8 = new Slider({
$target: '#slider8',
orientation: 'horizontal',
value: 20,
type: 'min',
disabled: true
});
var s9 = new Slider({
$target: '#slider9',
orientation: 'horizontal',
create: function (e) {
console.log('create');
},
start: function (e) {
console.log('start');
},
slide: function (e) {
console.log('slide');
},
stop: function (e) {
console.log('stop');
},
destroy: function (e) {
console.log('destroy');
},
change: function (e) {
console.log('change');
}
});
var s10 = new Slider({
$target: '#slider10',
orientation: 'horizontal',
type: 'max'
});
$('#J_btn_value').on('click', function () {
s10.setter('value', 30);
});
$('#J_btn_percent').on('click', function () {
s10.setter('value', '62%');
});
var s11 = new Slider({
$target: '#slider11',
orientation: 'horizontal',
});
$('#J_btn_display').on('click', function () {
var $self = $(this);
if ($self.html() === '隐藏组件') {
$self.html('显示组件');
s11.hide();
} else {
$self.html('隐藏组件');
s11.show();
}
});
$('#J_btn_destroy').on('click', function () {
var $self = $(this);
s11.destroy();
$self.attr('disabled', true);
$('#J_btn_display').attr('disabled', true);
});