mirror of
https://github.com/PitPik/tinyColorPicker
synced 2025-06-28 13:41:02 -06:00
new RGB slider demo (update)
This commit is contained in:
parent
0aceb92bc8
commit
5d92b35a7d
9
index.js
9
index.js
@ -508,13 +508,14 @@
|
|||||||
this.$cursorG = $elm.find('.cp-rgb-g-cursor');
|
this.$cursorG = $elm.find('.cp-rgb-g-cursor');
|
||||||
this.$cursorB = $elm.find('.cp-rgb-b-cursor');
|
this.$cursorB = $elm.find('.cp-rgb-b-cursor');
|
||||||
|
|
||||||
$elm.on('mousedown', '.cp-rgb-r-cursor, .cp-rgb-g-cursor, .cp-rgb-b-cursor', function(e) {
|
$elm.on('mousedown', '.cp-rgb-r, .cp-rgb-g, .cp-rgb-b', function(e) {
|
||||||
$currentSlider = $(this);
|
$currentSlider = $(this);
|
||||||
currentRGB = this.className.replace(/cp-rgb-(\D){1}-cursor/, "$1");
|
currentRGB = this.className.replace(/cp-rgb-(\D){1}/, "$1");
|
||||||
currentOffset = $currentSlider.parent().offset();
|
currentOffset = $currentSlider.offset();
|
||||||
that.currentWidth = $currentSlider.parent()[0].clientWidth;
|
that.currentWidth = $currentSlider[0].clientWidth;
|
||||||
$window.on('mousemove.rgb', mouseMove);
|
$window.on('mousemove.rgb', mouseMove);
|
||||||
e.preventDefault && e.preventDefault();
|
e.preventDefault && e.preventDefault();
|
||||||
|
mouseMove(e);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
$window.on('mouseup', function(e) {
|
$window.on('mouseup', function(e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user