我正在爲使用模板的建築公司設計一個網頁。該html文件使用名爲app.js的js文件。每當我編輯js文件時,整個html頁面都變得無法響應,就好像js文件從不在那裏一樣。這裏是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「第四人稱」我在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頁面變得不響應創建。請告訴我什麼可能是問題,並儘可能解決方案
在HTML中是否有'#fourth-person'元素? – Aenadon
控制檯中的錯誤是什麼? – Nisarg
您是否檢查了控制檯的語法錯誤,因爲這對我來說看起來像是語法錯誤。 – Li357