TA的每日心情 | 衰 2017-12-5 11:53 |
---|
签到天数: 3 天 [LV.2]偶尔看看I
新手上路
- 积分
- 44
|
本帖最后由 zjk 于 2017-11-27 14:19 编辑
新人求助,在第一个位置和最后一个位置时无法滑动,按键无效,具体代码如下:请大神帮忙!!<div class="first_content">
<div class="swiper-wrapper">
<a class="swiper-slide xs_box" href="#" data-position = "0">
<div class="big">
1
</div>
</a>
<a class="swiper-slide xs_box" href="#" data-position="1">
<div class="big">
2
</div>
</a>
......
</div>
</div>
var swiper_first_content = new Swiper('.first_content', {
slidesPerView: 4,spaceBetween: 20,
});
$('.xs_box').on("focus",function(event){
if(last_key == REMOTE_LEFT){
swiper_first_content.slidePrev();
} else if(last_key == REMOTE_RIGHT) {
swiper_first_content.slideNext();
}
});
|
|