###### tags: `套件` `wow js` # wow js ## wow 隨著滑鼠滾動重複播放動畫? 可以偵測滑鼠滾動高度 ```javascript= window.addEventListener('scroll', function(e) { if( $(window).scrollTop() >= 50) { $('.wow').removeClass('animated'); $('.wow').removeAttr('style'); new WOW().init(); } }); ``` 參考: 1.[WOW.js will only show animation one time on scrolling past it](https://github.com/matthieua/WOW/issues/46) 2.[example](https://jsfiddle.net/ugurerkan/53641ovn/) 3.[Wow.js repeat animation every time you scroll up or down](https://stackoverflow.com/questions/33187211/wow-js-repeat-animation-every-time-you-scroll-up-or-down) 4.[example](https://codepen.io/benoitboucart/pen/yJoqz) ## 有時候 dots和nav都已經是true了,為什麼還是看不到導覽元素? ```javascript= $('.roleItem').owlCarousel({ lazyLoad: true, loop: true, autoplay: true, touchDrag: true, dots: true, //已經打開了 nav: true, //已經打開了 smartSpeed: 1000, autoplayTimeout: 7500, items: 4 //如果小於或等於4個項目,將不會出現導覽元素 }) ``` 因為我們預設的`items:4`,表示一列顯示4個項目,如果你現在就只有4個項目,當然不會顯示dots和nav的導覽元素,除非 >4 個項目,才會出現dots和nav的導覽元素。
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up