Malanleitungen
Sortierung
Filter
Preis
€
―
€
"use strict";
var keypressSlider = document.querySelector(".slider-keypress");
var input0 = document.querySelector(".input-with-keypress-0");
var input1 = document.querySelector(".input-with-keypress-1");
var inputs = [input0, input1];
noUiSlider.create(keypressSlider, {
start: [13.75, 85],
connect: true,
range: {
min: [13.75],
max: [85]
}
});
keypressSlider.noUiSlider.on("update", function(values, handle) {
inputs[handle].value = values[handle];
function setSliderHandle(i, value) {
var r = [null, null];
r[i] = value;
keypressSlider.noUiSlider.set(r);
}
inputs.forEach(function(input, handle) {
input.addEventListener("change", function() {
setSliderHandle(handle, this.value);
});
input.addEventListener("keydown", function(e) {
var values = keypressSlider.noUiSlider.get();
var value = Number(values[handle]);
var steps = keypressSlider.noUiSlider.steps();
var step = steps[handle];
var position;
switch (e.which) {
case 13: setSliderHandle(handle, this.value); break;
case 38: position = step[1]; if (position === false) { position = 1; } if (position !== null) {setSliderHandle(handle, value + position); } break;
case 40: position = step[0]; if (position === false) { position = 1; } if (position !== null) { setSliderHandle(handle, value - position); } break;
}
});
});
});
Verfügbarkeit
Hersteller
Sprache
Kategorien
Kategorien
- AK Learning Wargames Series 4 Scenery Techniques (Englisch)13,75 EUR *1 Stück* inkl. MwSt. zzgl. Versand
- AK Learning Wargames Series 3 Landship Techniques (Englisch)13,75 EUR *1 Stück* inkl. MwSt. zzgl. Versand
- AK Learning Wargames Series 2 Starship Techniques Advanced (Englisch)13,75 EUR *1 Stück* inkl. MwSt. zzgl. Versand
- AK Learning Wargames Series 1 Starship Techniques Beginner (Englisch)13,75 EUR *1 Stück* inkl. MwSt. zzgl. Versand
- -5%Army Painter Gamemaster Wilderness Adventures Paint Set
Statt 49,99 EUR47,50 EUR ** inkl. MwSt. zzgl. Versand - -5%Army Painter Gamemaster Wandering Monsters Paint Set
Statt 49,99 EUR47,50 EUR ** inkl. MwSt. zzgl. Versand - AK Learning 11 Figure Sculpting & Converting Techniques13,75 EUR *1 Stück* inkl. MwSt. zzgl. Versand
- AK Learning 09 The Ultimate Guide to make Buildings in Dioramas13,75 EUR *1 Stück* inkl. MwSt. zzgl. Versand
- Airbrush für Modellbau 3D-Druck und Tabletop (Deutsch)18,95 EUR *1 Stück* inkl. MwSt. zzgl. Versand
- JETZT im SALE!
Preis
€
―
€
"use strict";
var keypressSlider = document.querySelector(".slider-keypress");
var input0 = document.querySelector(".input-with-keypress-0");
var input1 = document.querySelector(".input-with-keypress-1");
var inputs = [input0, input1];
noUiSlider.create(keypressSlider, {
start: [13.75, 85],
connect: true,
range: {
min: [13.75],
max: [85]
}
});
keypressSlider.noUiSlider.on("update", function(values, handle) {
inputs[handle].value = values[handle];
function setSliderHandle(i, value) {
var r = [null, null];
r[i] = value;
keypressSlider.noUiSlider.set(r);
}
inputs.forEach(function(input, handle) {
input.addEventListener("change", function() {
setSliderHandle(handle, this.value);
});
input.addEventListener("keydown", function(e) {
var values = keypressSlider.noUiSlider.get();
var value = Number(values[handle]);
var steps = keypressSlider.noUiSlider.steps();
var step = steps[handle];
var position;
switch (e.which) {
case 13: setSliderHandle(handle, this.value); break;
case 38: position = step[1]; if (position === false) { position = 1; } if (position !== null) {setSliderHandle(handle, value + position); } break;
case 40: position = step[0]; if (position === false) { position = 1; } if (position !== null) { setSliderHandle(handle, value - position); } break;
}
});
});
});