
페이지 스크롤시 나타나는 글자 질문입니다!
와 위 블로그의 3번을 참고했는데요,
페이지 스크롤시 글자가 나타나는 건 성공했는데
스크롤을 내려 첫 문장이 보여진 이후, 차례대로 딜레이되면서
딴딴딴 나타나는건 작동이 안되더라고요
뭉텅이로 한꺼번에 나타나는걸 고치고 싶어요ㅜㅜ
어디가 잘못된걸까요??
<head>
<meta charset="UTF-8">
<title>타이틀입니다</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.css"
/>
</head>
<style>
.text {
opacity:0;
margin-down:-30px;
max-width:100%;
color: #B0C4DE;
margin: 500px 0px 100px 0px;
display:flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
</style>
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>
<script>
$(document).ready(function () {
$(window).scroll(function () {
$('.text').each(function (i) {
var bottom_of_element = $(this).offset().top + $(this).outerHeight();
var bottom_of_window = $(window).scrollTop() + $(window).height();
if (bottom_of_window > bottom_of_element) {
$(this).animate({'opacity': '1', 'margin-down': '0px'}, 1000);
}
});
});
});
</script>
<body>
<div class="text" div style="font: 300 normal 1.5em/0.6em YUniverse-B;">
<p class="animate__animated animate__fadeInDown">하나</p>
<p class="animate__animated animate__fadeInDown animate__delay-1s">둘</p>
<p class="animate__animated animate__fadeInDown animate__delay-1s">셋</p>
<p class="animate__animated animate__fadeInDown animate__delay-2s">넷</p>
<p class="animate__animated animate__fadeInDown animate__delay-2s">다섯</p>
</div>
</body>
