jquery – 当幻灯片不在原始位置时,idangerous swiper link无法正常工作

前端之家收集整理的这篇文章主要介绍了jquery – 当幻灯片不在原始位置时,idangerous swiper link无法正常工作前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

使用idangerous swiper,请参阅Slide1让我们去谷歌.如果Slide1位于原始位置(框中的第一个左侧),则谷歌的链接将始终有效.但是,如果我们滑动(或鼠标左右拖放)并且Slide1位于第2或第3位,则点击将不起作用.

http://jsfiddle.net/C8ytu/

  1. Meta charset="UTF-8">
  2. 4040;
  3. }
  4. .blue-slide {
  5. background: #4390ee;
  6. }
  7. .orange-slide {
  8. background: #ff8604;
  9. }
  10. .green-slide {
  11. background: #49a430;
  12. }
  13. .pink-slide {
  14. background: #973e76;
  15. }
  16. .swiper-slide .title {
  17. font-style: italic;
  18. font-size: 42px;
  19. margin-top: 80px;
  20. margin-bottom: 0;
  21. line-height: 45px;
  22. }
  23. .pagination {
  24. position: absolute;
  25. z-index: 20;
  26. left: 10px;
  27. bottom: 10px;
  28. }
  29. .swiper-pagination-switch {
  30. display: inline-block;
  31. width: 8px;
  32. height: 8px;
  33. border-radius: 8px;
  34. background: #222;
  35. margin-right: 5px;
  36. opacity: 0.8;
  37. border: 1px solid #fff;
  38. cursor: pointer;
  39. }
  40. .swiper-visible-switch {
  41. background: #aaa;
  42. }
  43. .swiper-active-switch {
  44. background: #fff;
  45. }
最佳答案
您必须在代码中添加loopAdditionalSlides:3并解决您的问题.

见这里JSFiddle

JS:

  1. var mySwiper = new Swiper('.swiper-container',loopAdditionalSlides:3,//<-- This one
  2. paginationClickable: true,loop: true
  3. });

loopAdditionalSlides:“创建循环后将克隆的幻灯片添加数量

Documentation: Swiper Usage and API

猜你在找的HTML相关文章