Error with jQuery ColorPicker

2

I'm using the jQuery ColorPicker but it is giving the following error:

  

Uncaught TypeError: Object [object Object] has no method 'ColorPicker'

My code looks like this:

<html>
    <head>
        <script type="text/javascript" src="/js/jquery-1.10.2.min.js"></script>
        <script type="text/javascript" src="/js/jquery-ui-1.10.4.custom.min.js"></script>
        <script type="text/javascript" src="/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="colorpicker/js/colorpicker.js" charset="utf-8"></script>
        <script type="text/javascript" src="colorpicker/js/eye.js" charset="utf-8"></script>
        <script type="text/javascript" src="colorpicker/js/utils.js" charset="utf-8"></script>
    </head>
    <body>
        <div id="style-colors">
            <div class="cores">
                <label for="">Cor</label>
                <div class="sc-background">
                    <div style="background-color: #0000ff"></div>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            $(document).ready(function(){
                $('.sc-background').ColorPicker();
            });
        </script>
    </body>
</html>

Can anyone help me with this error?

    
asked by anonymous 28.03.2014 / 02:10

2 answers

1

I downloaded the jQuery ColorPicker package and saw that the jQuery file that comes with it is version 1.3.2.

Version 1.10 has major changes compared to 1.3.2, so try loading the jQuery file from the package that is downloaded along with jQuery ColorPicker, to 1.3.2 to confirm that the problem is not caused by this.

    
28.03.2014 / 02:42
0
  

Uncaught TypeError: Object [object Object] has no method 'ColorPicker'

This error occurred because the ColorPicker library was not included correctly, I recommend unlike using a library to use the "new input" <input type="color" /> with a Polyfill like the Spectrum for example.

In addition, I found on Wikipedia a jQuery UI article talking about it, ( here ) , it cites some libraries that should fit your preferences.

    
28.03.2014 / 13:36