この問題が発生しました。onmousedown
とonselectstart
イベントを特定のhtml要素に追加する必要があります。私はこれで試しましたが、属性ではないので、これはうまくいきません。html要素にイベントを追加する
$(".question, p, b, span, img").each(function(){
$(this).addClass("disableSelection");
$(this).attr("onmousedown", "return false;");
$(this).attr('onselectstart', 'return false;');
});
例
<p onmousedown="return false;" onselectstart="return false;">Adding events</p>
から
必ず素敵なソリューションが、これは.disableSelectionクラスではなく、私はで動作するようにこれを必要とすることを使用して
イムの中には動作しません注意してください古いブラウザ – Polo