Browse Source

added css prepend

master
peterd 3 years ago
parent
commit
999178d089
4 changed files with 10 additions and 7 deletions
  1. 2
    1
      README.md
  2. 5
    3
      jqColorPicker.js
  3. 1
    1
      jqColorPicker.js.map
  4. 2
    2
      jqColorPicker.min.js

+ 2
- 1
README.md View File

@@ -106,7 +106,8 @@ $('.color').colorPicker({
light: '#DDD' // default font color if background is dark
preventFocus: false // prevents default on focus of input fields (e.g. no keyboard on mobile)
body: document.body // the element where the events are attached to (touchstart, mousedown, pointerdown, focus, click, change),
forceAlpha: // force printing alpha channel (undefined = auto; false = never print alpha)
forceAlpha: // force printing alpha channel (undefined = auto; false = never print alpha),
cssPrepend: // makes add CSS being added to the beginning of the <head> instead of to the end
});
```
See the following section or the demos on how the callbacks work and what you can do with them...

+ 5
- 3
jqColorPicker.js View File

@@ -123,8 +123,9 @@
}

function build() {
$('head').append('<style type="text/css" id="tinyColorPickerStyles">' +
(_options.css || _css) + (_options.cssAddon || '') + '</style>');
$('head')[_options.cssPrepend ? 'prepend' : 'append']
('<style type="text/css" id="tinyColorPickerStyles">' +
(_options.css || _css) + (_options.cssAddon || '') + '</style>');

return $(_html).css({'margin': _options.margin})
.appendTo('body')
@@ -281,7 +282,8 @@
scrollResize: true,
gap: 4,
dark: '#222',
light: '#DDD'
light: '#DDD',
// cssPrepend: true,
// forceAlpha: undefined,
// css: '',
// cssAddon: '',

+ 1
- 1
jqColorPicker.js.map
File diff suppressed because it is too large
View File


+ 2
- 2
jqColorPicker.min.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save