채택완료
제이쿼리로 after 가상요소를 선택해서 효과

.txt_wrap:after{position:absolute; bottom:-160px; content: ''; display: inline-block; width: 2px; height: 110px; background: #fff; opacity: 0; transform: translateY(-500px); transition: 1s 0.8s cubic-bezier(0.33, 1, 0.68, 1);}
.txt_wrap:after.on{opacity: 1; transform: translateY(0px);}
제이쿼리로 스크롤을 하면 addclass를 on을 주고싶은데 안먹네요.. 가상요소는 불가능한가요 ? ㅠㅠ
|
답변 2개 / 댓글 2개
채택된 답변
+20 포인트
해당코드는 적용되지 않는다고 합니다.
But,
$('.txt_wrap:after').addClass('on');
->
$('.txt_wrap').addClass('on');
으로 수정하면 원하는 결과를 얻을 수도 있지 않을까 합니다.
답변을 작성하려면 로그인이 필요합니다.