diff --git a/README.md b/README.md index 690ca50..90bdba2 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/demo/index.js b/demo/index.js index 7af685f..8b07951 100644 --- a/demo/index.js +++ b/demo/index.js @@ -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 - diff --git a/demo/mod.css b/demo/mod.css index 3b2f6db..37a31f8 100644 --- a/demo/mod.css +++ b/demo/mod.css @@ -8,6 +8,10 @@ margin: 5px 0 0; } +#content-wrapper { + /* position: relative; */ +} + .cp-color-picker:after, .cp-color-picker:before { content: "";