Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8519093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:09:13+00:00 2026-06-11T06:09:13+00:00

I am using this jQuery color picker for a CMS theme creator: http://www.eyecon.ro/colorpicker/ They

  • 0

I am using this jQuery color picker for a CMS theme creator: http://www.eyecon.ro/colorpicker/

They are currently set up like this for each color picker:

<div class="colorSelector" id="colorSelector3"><div style="background-color: #0000ff"></div></div>

With this for the javascript:

$('#colorSelector3').ColorPicker({
color: '#0000ff',
onShow: function (colpkr) {
    $(colpkr).fadeIn(500);
    return false;
},
onHide: function (colpkr) {
    $(colpkr).fadeOut(500);
    return false;
},
onChange: function (hsb, hex, rgb) {
    $('#colaAlpha a').css('color', '#' + hex);
    $('#colorSelector3 div').css('backgroundColor', '#' + hex);
}

});

The problem is I need to create a large amount of color pickers and it would be great to have one function where I pass in the id of the picker and the id of the element/s to be changed. Is this possible?

This didn’t work:

function colorPickMulti(itemid, cp){
$(cp).ColorPicker({
color: '#0000ff',
onShow: function (colpkr) {
    $(colpkr).fadeIn(500);
    return false;
},
onHide: function (colpkr) {
    $(colpkr).fadeOut(500);
    return false;
},
onChange: function (hsb, hex, rgb) {
$(itemid).css('color', '#' + hex);
$(cp + ' div').css('backgroundColor', '#' + hex);
}
});
}

Could I create the functions dynamically some way? Any help would be great! Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:09:15+00:00Added an answer on June 11, 2026 at 6:09 am
    <div class="colorSelector" id="colorSelector3"><div style="background-color: #0000ff"></div></div>
    <div class="colorSelector" id="colorSelector4"><div style="background-color: #0000ff"></div></div>
    
    <script type="text/javascript">
    function colorPickMulti(itemid, cp){
        $(cp).ColorPicker({
            color: '#0000ff',
            onShow: function (colpkr) {
                $(colpkr).fadeIn(500);
                return false;
            },
            onHide: function (colpkr) {
                $(colpkr).fadeOut(500);
                return false;
            },
            onChange: function (hsb, hex, rgb) {
                $(itemid).css('color', '#' + hex);
                $(cp + ' div').css('backgroundColor', '#' + hex);
            }
        });
    }
    
    $('#colorSelector3').click(function(){
        colorPickMulti('itemid', 'cp');
    });
    
    $('#colorSelector4').click(function(){
        colorPickMulti('itemid', 'cp');
    });
    
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all, I'm using this colorpicker ( http://www.eyecon.ro/colorpicker ) and am trying to capture
I'm using this JQuery autocomplete plugin http://www.devbridge.com/projects/autocomplete/jquery/ in my project. I followed this tutorial
I am using the following jQuery Color plugin: /* Color animation jQuery-plugin http://www.bitstorm.org/jquery/color-animation/ Copyright
Im using this plugin: http://www.fyneworks.com/jquery/star-rating It includes a star.gif (which actually contains the star
i currently need some help, im using [Jquery Minicolors color picker][1] and i wanted
I'm currently using this jQuery validate plugin and having an issue in IE where
I've downloaded the Really Simple Color Picker in jQuery from this site I've followed
Im using the color picker here: http://blog.meta100.com/post/600571131/mcolorpicker Im using code shown in example 3.
I am using jQuery ColorPicker Plugin and I would like to use this multiple
im using this jquery plugin which is a colorpicker, but i was wondering when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.