テンプレートを使用して建設会社のWebページを設計しています。 htmlファイルは、app.jsというjsファイルを使用します。私はjsファイルを編集するたびに、jsファイルがそこに決して存在しなかったかのように、htmlページ全体が応答しなくなります。ここにapp.jsファイルに存在するコードがあります。app.jsファイルが編集されていても機能しなくなる
//animate first team member
jQuery('#first-person').bind('inview', function (event, visible) {
if (visible == true) {
jQuery('#first-person').addClass("animated pulse");
} else {
jQuery('#first-person').removeClass("animated pulse");
}
});
//animate sectond team member
jQuery('#second-person').bind('inview', function (event, visible) {
if (visible == true) {
jQuery('#second-person').addClass("animated pulse");
} else {
jQuery('#second-person').removeClass("animated pulse");
}
});
//animate thrid team member
jQuery('#third-person').bind('inview', function (event, visible) {
if (visible == true) {
jQuery('#third-person').addClass("animated pulse");
} else {
jQuery('#third-person').removeClass("animated pulse");
}
ファイルはこのあらかじめ記述されたスクリプトで正常に動作します。私は新しいIDの次の行を追加しようとするが、「第4人は、」私は、HTMLページが無応答になったHTMLファイルに
//animate fourth team member
jQuery('#fourth-person').bind('inview', function (event, visible) {
if (visible == true) {
jQuery('#fourth-person').addClass("animated pulse");
} else {
jQuery('#fourth-person').removeClass("animated pulse");
}
を作成しました。可能であれば問題と解決策を教えてください
HTMLに '#fourth-person'要素がありますか? – Aenadon
コンソールのエラーは何ですか? – Nisarg
コンソールに構文エラーがないかチェックしました。構文エラーです。 – Li357