제이쿼리로 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
해당코드는 적용되지 않는다고 합니다.
But,
$('.txt_wrap:after').addClass('on');
->
$('.txt_wrap').addClass('on');
으로 수정하면 원하는 결과를 얻을 수도 있지 않을까 합니다.
1.
.txt_wrap.on:after{효과 css}
2.
제이쿼리로 .on 을 addclass 해주시고
3.
on 에다가 after를 주시면 되지않을까요?
답변을 작성하시기 전에 로그인 해주세요.