star-classroom.js 1.3 KB
/**
 * 星潮教室
 * @author: wsl<shuiling.wang@yoho.cn>
 * @date: 2016/4/11
 */

var $ = require('jquery'),
    Swiper = require('yoho.iswiper');

var bannerSwiper, collocationSwiper;

if ($('.banner-swiper').find('li').length > 1) {
    bannerSwiper = new Swiper('.banner-swiper', {
        lazyLoading: true,
        lazyLoadingInPrevNext: true,
        loop: true,
        autoplay: 3000,
        autoplayDisableOnInteraction: false,
        paginationClickable: true,
        slideElement: 'li',
        pagination: '.banner-top .pagination-inner'
    });
}

if ($('.collocation-swiper').find('li').length > 1) {
    collocationSwiper = new Swiper('.collocation-swiper', {
        lazyLoading: true,
        lazyLoadingInPrevNext: true,
        lazyLoadingOnTransitionStart: true,
        grabCursor: true,
        slidesPerView: 'auto',
        slideElement: 'li',
        watchSlidesVisibility: true
    });
}

if ($('.artice-zan').find('li').length > 0) {
    $('.zan-more').show();
}

$('.add-intimacy').on('click', function() {
    $('.pop-intimacy').show();
    $('.mask').show();

    $('body').css({
        overflow: 'hidden'
    });
});

$('.pop-intimacy .pop-close, .mask').on('click', function() {
    $('.pop-intimacy').hide();
    $('.mask').hide();

    $('body').css({
        overflow: 'visible'
    });
});