Ask questions and get good answers on mb.jQuery.components

Hi folks !

i want to use a color picker to change dynamically css styles of a container.

I found this colorPicker : http://blog.meta100.com/post/600571131/mcolorpicker I tested it on the background color of the page, it works, perfectly.

Problems come when i try to use it for a mbContainer.

With this, i want to change color of "Lorem Ipsum blah blah blah" of :

<div id="myContainer" class="containerPlus ...">
<p>Lorem Ipsum blah blah blah</p>
</div>

In the header i put this :

<script type="text/javascript" src="/js/mColorPicker.js"></script>

<script type="text/javascript" charset="UTF-8">
      $(document).ready(function colorPicker() {

        $('form#colorPicker').bind('submit', function () {

          alert($(this).serialize());
          return false;
        });
        $('#color1').bind('change', function () {

          $('#myContainer p').css('color', $(this).val());
        });

      });
    </script>

Could someboby help me ?

asked May 06 '11 at 11:32

juldro's gravatar image

juldro
11

edited May 06 '11 at 11:34


You should try inspecting the code and see what CSS are applied to your P element into the container; there could be some !important attribute that prevent your method to work correctly...

answered May 14 '11 at 07:13

Matteo%20Bicocchi's gravatar image

Matteo Bicocchi ♦♦
1776129

edited May 14 '11 at 07:13

Your answer
toggle preview

jQuery main site - Matteo Bicocchi