Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}), function (percentage) {
$preloader_content.text((percentage * 100).toFixed(0) + '%');
if (percentage >= 1) {
$preloader.addClass('leave').one($.transitionEnd.end, function () {
$preloader.remove();
}).emulateTransitionEnd(PRE_LEAVE_DURATION);
//带懒加载的滑屏
new Swiper('#swiper', {
direction: 'vertical',
preloadImages: false,
lazyLoading: true,
lazyLoadingInPrevNext: true,
lazyLoadingInPrevNextAmount: 1,
slidesPerView: 1
});
}
});
});
define(function (require, exports, module) {
var $ = require('jquery'),
Scroller = require('mod/scroller'),
Swiper = require('swiper.jquery');
//禁止默认的滚动操作
Scroller.stopDefaultTouch();
var $tabs = $("#tabs"),
tabSwiper = new Swiper('#swiper-tab-content', {
speed: 500,
onSlideChangeStart: function () {
$tabs.children('.active').removeClass('active');
$tabs.children().eq(tabSwiper.activeIndex).addClass('active');
}
});
$tabs.on('click', 'a', function (e) {
e.preventDefault();
$tabs.children('.active').removeClass('active');
var $parent = $(this).parent();
$parent.addClass('active');
tabSwiper.slideTo($parent.index());
});
});
define(function (require, exports, module) {
var $ = require('jquery'),
Scroller = require('mod/scroller'),
Swiper = require('swiper.jquery');
//禁止默认的滚动操作
Scroller.stopDefaultTouch();
var $tabs = $("#tabs"),
tabSwiper = new Swiper('#swiper-tab-content', {
speed: 500,
onSlideChangeStart: function () {
$tabs.children('.active').removeClass('active');
$tabs.children().eq(tabSwiper.activeIndex).addClass('active');
}
});
$tabs.on('click', 'a', function (e) {
e.preventDefault();
$tabs.children('.active').removeClass('active');
var $parent = $(this).parent();
$parent.addClass('active');
tabSwiper.slideTo($parent.index());
});
});