jquery - idangerous swiper link not working when slide is not on original position -
using idangerous swiper, see slide1 lets go google
. if slide1 @ original position (first left in box) link google work. if swipe (or mouse drag , drop left , right) , slide1 @ position 2 or 3, click won't work.
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>demo</title> <link rel="stylesheet" href="http://www.idangero.us/sliders/swiper/css/idangerous.swiper.css"> <style> /* demo styles */ body { margin: 0; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 1.5; } .swiper-container { width: 660px; height: 250px; color: #fff; text-align: center; } .red-slide { background: #ca4040; } .blue-slide { background: #4390ee; } .orange-slide { background: #ff8604; } .green-slide { background: #49a430; } .pink-slide { background: #973e76; } .swiper-slide .title { font-style: italic; font-size: 42px; margin-top: 80px; margin-bottom: 0; line-height: 45px; } .pagination { position: absolute; z-index: 20; left: 10px; bottom: 10px; } .swiper-pagination-switch { display: inline-block; width: 8px; height: 8px; border-radius: 8px; background: #222; margin-right: 5px; opacity: 0.8; border: 1px solid #fff; cursor: pointer; } .swiper-visible-switch { background: #aaa; } .swiper-active-switch { background: #fff; } </style> </head> <body> <div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide red-slide"> <div class="title"><a href="http://www.google.com" target="_blank">lets go google</a></div> </div> <div class="swiper-slide blue-slide"> <div class="title">slide 2</div> </div> <div class="swiper-slide orange-slide"> <div class="title">slide 3</div> </div> <div class="swiper-slide green-slide"> <div class="title">slide 4</div> </div> <div class="swiper-slide pink-slide"> <div class="title">slide 5</div> </div> <div class="swiper-slide red-slide"> <div class="title">slide 6</div> </div> <div class="swiper-slide blue-slide"> <div class="title">slide 7</div> </div> <div class="swiper-slide orange-slide"> <div class="title">slide 8</div> </div> </div> <div class="pagination"></div> </div> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://www.idangero.us/sliders/swiper/js/idangerous.swiper.js"></script> <script> var myswiper = new swiper('.swiper-container',{ pagination: '.pagination', paginationclickable: true, slidesperview: 3, loop: true }) </script> </body> </html>
you have add loopadditionalslides:3
in code , solve problem.
see here jsfiddle
js:
var myswiper = new swiper('.swiper-container',{ pagination: '.pagination', loopadditionalslides:3, //<-- 1 paginationclickable: true, slidesperview: 3, loop: true });
loopadditionalslides:
"addition number of slides cloned after creating of loop"
Comments
Post a Comment