Вам необходимо привязать функцию к контексту, поэтому перед вызовом функции объявите, что
var that = this // or whatever this(the context) is
, а затем вызовите ее в обратном вызове вместо этого.
...)onChange: function (hsb, hex, rgb) {
$(that).css('backgroundColor', '#' + hex);
}
РЕДАКТИРОВАТЬ: вот код javascript, который я бы написал.
$(document).ready(function() {
$('.colorpickerHolder').each(function(o) {
var _this = this;
$(this).ColorPicker({
onChange: function(hsb, hex, rgb) {
_this.style.background = '#' + hex;
// the input which is trigger the colorpicker is supposed to be $(THIS);
}
})
})
});
http://jsfiddle.net/camus/PQDf8/4/