No Description

swiper.animate.min.js 1.9KB

1234567891011121314151617181920212223242526
  1. //本插件由www.swiper.com.cn提供
  2. function swiperAnimateCache() {
  3. for (var allBoxes = window.document.documentElement.querySelectorAll(".ani"), i = 0; i < allBoxes.length; i++) allBoxes[i].attributes["style"] ? allBoxes[i].setAttribute("swiper-animate-style-cache", allBoxes[i].attributes["style"].value) : allBoxes[i].setAttribute("swiper-animate-style-cache", " "),
  4. allBoxes[i].style.visibility = "hidden"
  5. }
  6. function swiperAnimate(a) {
  7. var effect,style,duration,delay;
  8. clearSwiperAnimate();
  9. var b = a.slides[a.activeIndex].querySelectorAll(".ani");
  10. for (var i = 0; i < b.length; i++) b[i].style.visibility = "visible",
  11. effect = b[i].attributes["swiper-animate-effect"] ? b[i].attributes["swiper-animate-effect"].value: "",
  12. b[i].className = b[i].className + " " + effect + " " + "animated",
  13. style = b[i].attributes["style"].value,
  14. duration = b[i].attributes["swiper-animate-duration"] ? b[i].attributes["swiper-animate-duration"].value: "",
  15. duration && (style = style + "animation-duration:" + duration + ";-webkit-animation-duration:" + duration + ";"),
  16. delay = b[i].attributes["swiper-animate-delay"] ? b[i].attributes["swiper-animate-delay"].value: "",
  17. delay && (style = style + "animation-delay:" + delay + ";-webkit-animation-delay:" + delay + ";"),
  18. b[i].setAttribute("style", style)
  19. }
  20. function clearSwiperAnimate() {
  21. var effect;
  22. for (var allBoxes = window.document.documentElement.querySelectorAll(".ani"), i = 0; i < allBoxes.length; i++) allBoxes[i].attributes["swiper-animate-style-cache"] && allBoxes[i].setAttribute("style", allBoxes[i].attributes["swiper-animate-style-cache"].value),
  23. allBoxes[i].style.visibility = "hidden",
  24. allBoxes[i].className = allBoxes[i].className.replace("animated", " "),
  25. allBoxes[i].attributes["swiper-animate-effect"] && (effect = allBoxes[i].attributes["swiper-animate-effect"].value, allBoxes[i].className = allBoxes[i].className.replace(effect, " "))
  26. }