답변 1개
https://github.com/thesmart/jquery-scrollspy
여기서 다운받아서 /js 파일 에 넣어 주시고요
https://gist.github.com/PaulGwamanda/bcdfd1adea5144fefa1a9d6939340b67
에서 내용을 wow 하단에 처럼 넣어 주시면 됩니다
위치에 따라 안나오실수 있으니 제일 하단에 넣으세요.
<script src="/js/scrollspy.js"></script>
<script type="text/javascript">
<!--
WOW.prototype.addBox = function(element) {
this.boxes.push(element);
};
// Init WOW.js and get instance
var wow = new WOW();
wow.init();
// Attach scrollSpy to .wow elements for detect view exit events,
// then reset elements and add again for animation
$('.wow').on('scrollSpy:exit', function() {
$(this).css({
'visibility': 'hidden',
'animation-name': 'none'
}).removeClass('animated');
wow.addBox(this);
}).scrollSpy();
//-->
</script>
답변에 대한 댓글 2개
this.boxes.push(element);
};
이하부분은 dom 생성후 작용하는 부분이라서 </body>앞쪽에 넣어주셔야 합니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
<script src="wow.js"></script>
<script src="scrollspy.js"></script>
<script>
WOW.prototype.addBox = function(element) {
this.boxes.push(element);
};
// Init WOW.js and get instance
var wow = new WOW();
wow.init();
// Attach scrollSpy to .wow elements for detect view exit events,
// then reset elements and add again for animation
$('.wow').on('scrollSpy:exit', function() {
$(this).css({
'visibility': 'hidden',
'animation-name': 'none'
}).removeClass('animated');
wow.addBox(this);
}).scrollSpy();
</script>