超炫游戏角色介绍jQuery幻灯片特效
![超炫游戏角色介绍jQuery幻灯片特效](/uploads/images/20180126/f52709b92f493d00c63693171f86824b.jpg)
下载次数:5
文件大小:8.57KB
所需积分:0
QQ联系购买积分:3331653644(1元=10积分)
$('.slide-nav').on('click', function(e) {
e.preventDefault();
// get current slide
var current = $('.flex--active').data('slide'),
// get button data-slide
next = $(this).data('slide');
$('.slide-nav').removeClass('active');
$(this).addClass('active');
if (current === next) {
return false;
} else {
$('.slider__warpper').find('.flex__container[data-slide=' + next + ']').addClass('flex--preStart');
$('.flex--active').addClass('animate--end');
setTimeout(function() {
$('.flex--preStart').removeClass('animate--start flex--preStart').addClass('flex--active');
$('.animate--end').addClass('animate--start').removeClass('animate--end flex--active');
}, 800);
}
});
0 条评论