
jquery.inview.jsを利用する場合においては、引数に「event」を記載する必要があったみたいです。
chatGPTに聞いてやってみたらうまくいきました!
$(function() {
$('#firstview').on('inview', function(event, isInView) {
if (isInView) {
$('.header__comment p').removeClass();
$('.header__comment p').addClass('header__comment-text');
$('.header__comment p').addClass('header__comment-firstview');
}
});
引用テキスト
$('#about').on('inview', function(event, isInView) {
if (isInView) {
$('.header__comment p').removeClass();
$('.header__comment p').addClass('header__comment-text');
$('.header__comment p').addClass('header__comment-about');
}
});
引用テキスト
$('#works').on('inview', function(event, isInView) {
if (isInView) {
$('.header__comment p').removeClass();
$('.header__comment p').addClass('header__comment-text');
$('.header__comment p').addClass('header__comment-works');
}
});
});

0 コメント