0
jqueryスペクトルカラーピッカーを使用しています。変更イベント内でスペクトルセレクタを取得する方法はありますか?jQueryスペクトルカラーピッカー
クラス(hap-ch)で複数の要素にスペクトルを適用すると、アクティブセレクタインスタンスを取得できますか?
<input id="playerBgColor" class="hap-ch">
<input id="playerBgColor2" class="hap-ch">
<input id="playerBgColor3" class="hap-ch">
$(".hap-ch").spectrum({
change: function(color) {
//how to get playerBgColor id here?
},
});
私は、私はこのような個別のスペクトルを適用することができます知っている:
$("#playerBgColor ").spectrum({
change: function(color) {
},
});
しかし、私は最初の例のように、複数のスペクトルのために、このコードを再利用できるかどうか知りたいと思いました。
あなたは 'デモfiddle'を追加してもらえますか? –