2
0
mirror of https://github.com/PitPik/tinyColorPicker synced 2025-07-18 23:44:29 -06:00

Demo for support for custom container

This commit is contained in:
peterd 2016-05-19 13:56:52 +02:00
parent 57c19961fd
commit 5cfdd6bfa8
3 changed files with 7 additions and 0 deletions

View File

@ -83,6 +83,7 @@ positionCallback: function($elm) {
}
}
```
This callback is also good if you need to append your colorPicker to a different element then document.body. This way you can calculate the coordinates relative to the appended container...
The renderCallback can be used as openCallback and closeCallback:

View File

@ -69,6 +69,8 @@ $(function(){
$window = $(window),
gap = this.color.options.gap; // this.color.options stores all options
// _$UI.appendTo('#content-wrapper'); // demonstration only
return { // this demo is a copy of the internal usage (to show how it works);
'left': (_$UI._left = position.left) -
((_$UI._left += _$UI._width -

View File

@ -8,6 +8,10 @@
margin: 5px 0 0;
}
#content-wrapper {
/* position: relative; */
}
.cp-color-picker:after,
.cp-color-picker:before {
content: "";