Skip to content

Option to not style the input element #138

Answered by mdbassit
glewe asked this question in Q&A
Discussion options

You must be logged in to vote

To support multiple instances, I'd recommend this method:

Coloris({
  el: "#txt_color",
  wrap: false,
  theme: "polaroid",
  themeMode: "dark",
  alpha: true,
  format: "hex",
  onChange: function (color, input) {
    var thumbnail = input.previousElementSibling; // This is the span.input-group-text

    if (thumbnail && thumbnail.firstElementChild) {
      thumbnail.firstElementChild.style.color = color;
    }
  }
});

Replies: 8 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@glewe
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@glewe
Comment options

Answer selected by mdbassit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #137 on March 20, 2024 15:43.