Owl Carousel fade effect not working

不想你离开。 提交于 2019-12-03 11:40:50

问题


I'm trying to apply the fade effect on a Owl Carousel but it does not seem to work.

As you can see in this fiddle - http://jsfiddle.net/lav911/fHa6J/ , I'm loading the transitions.css file mentioned in their docs.

Am I missing something? Why does it slide instead of fading ? Also, notice the fade does not work even on their site.

Later edit: It seems to fade on Google Chrome 35 and Firefox, but on Google Chrome 36 it will slide. Strange.


回答1:


It was reported apparently on the plugin's github repo - https://github.com/OwlFonk/OwlCarousel/issues/346

Simply using this version of the plugin (pull-request) fixed it.




回答2:


The problem is that owl plugin includes IE10 and 11 among the browsers that don't support CSS transform. So you can use owl carousel in combination with Modernizr and replace the "support3d" variable:

support3d = (asSupport !== null && asSupport.length === 1);

with

support3d = (Modernizr.csstransforms3d);

that seems to solve it! :)




回答3:


Since chrome now both supports -webkit-transform and the transform property, the owl code fails, since its 3dsupport detection is only returning true if the returned array (of transform styles) is equal to 1, simply change this line:

support3d = (asSupport !== null && asSupport.length === 1);

To this line:

support3d = (asSupport !== null && asSupport.length > 0);

And it should work ;)




回答4:


Change

support3d = (asSupport !== null && asSupport.length == 1);

to

support3d = (asSupport !== null && asSupport.length >= 1);

https://github.com/OwlFonk/OwlCarousel/issues/515




回答5:


From update 1.3.2 all transitions styles are moved out from main owl.carousel.css file to owl.transitions.css

Link owl.transitions.css in your head or import it in your css.



来源:https://stackoverflow.com/questions/24911447/owl-carousel-fade-effect-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!