SOで以前に回答した質問に基づいて、要素onClickにCSSクラスを追加するこのスクリプトを作成しました。問題は、それが1回しか機能しないことです。機能をリセットするにはどうすればよいですか?
これはjQueryコードです:
jQuery(function() {
jQuery('.close-button').click(function(){
jQuery(".content-display").addClass("cover");
jQuery(".close-button").addClass("cover");
});
jQuery('.project').click(function(){
jQuery('.content-display').addClass("uncover");
jQuery('.close-button').addClass("uncover");
});
});
そして、すべてをいじる。