How to use the swiper.jquery function in swiper

To help you get started, we’ve selected a few swiper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github liuyunzhuge / blog / h5_demo / src / js / app / youku_summer.js View on Github external
}), 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
            });
        }
    });
});
github liuyunzhuge / blog / animation / src / js / app / demo.js View on Github external
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());
    });
});
github liuyunzhuge / blog / animation / dist / js / app / demo.js View on Github external
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());
    });
});