要素でトグル クラスを操作しようとしていますが、スクリプトが他の関数を実行しており、クラス名で処理されているため、toggleClass 機能を使用できません。したがって、removeClass / addClass を使用しています。何らかの理由で、私はそれを機能させることができません。以下のスクリプトを見つけてください。
$(".view-followers").click(function(){
alert("off");
$(this).removeClass("view-followers");
$(this).addClass("view-followers-on");
});
$(".view-followers-on").click(function(){
alert("on");
$(this).removeClass("view-followers-on");
$(this).addClass("view-followers");
});
または、jsFiddle で表示できます。 http://jsfiddle.net/dannyj6/UGBda/
ご協力いただきありがとうございます。