zoukankan      html  css  js  c++  java
  • 提取的js,要先部署在远程,再引入

    var meet = {
        _w: document.documentElement.clientWidth,
        _h: document.documentElement.clientWidth,
        init: function () {
            this.videoHeight = this.getHeight(16 / 9);
            this.active();
            this.initSwiper();
            this.touchSwipeReview();
            this.showShare();
            this.closeShare();
            this.showReviewPoint();
            this.showCurrentPoint();
            this.reviewPointVideo();
        },
        initVideo: function (id, pic) {
            var _this = this;
            var player = new Txplayer({
                containerId: 'mod-player',
                vid: id,
                 _this._w,
                height: _this.videoHeight,
                poster: pic
            });
        },
        getHeight: function (scale) {
            return this._w / scale;
        },
        active: function () {
            var _this = this;
            $('.mod-player').css({
                'width': _this._w,
                'height': _this.videoHeight
            });
            $('#vide-content').css({
                'margin-top': (_this._h - _this.videoHeight) / 2
            })
            document.querySelector('body').addEventListener('touchmove', function (e) {
                if (!document.querySelector('.review-more').contains(e.target)) {
                    e.preventDefault();
                }
            })
            _this.initVideo('j0511ygervb', 'http://external-1255598498.file.myqcloud.com/public_h5/%E8%94%9A%E6%9D%A5H5/pic/%E5%B0%81%E9%9D%A2%E5%9B%BE.JPG');
        },
        initSwiper: function () {
            var mySwiper = new Swiper('.swiper-container', {
                direction: 'vertical',
                loop: false,
                pagination: '.swiper-pagination',
                speed: 200,
                onSlideChangeStart: function (swiper) {
                    console.log(swiper.activeIndex);
                    if (swiper.activeIndex === 2) {
                        $('.slider-up').addClass('slider-up-guide');
                    } else {
    
                    }
                }
            })
        },
        touchSwipeReview: function () {
            $(".review").swipe({
                swipe: function (event, direction, distance, duration, fingerCount, fingerData) {
                    if (direction === 'up') {
                    }
                }
            });
        },
        showShare: function () {
            $('#qrcodeShow').on('click', function () {
                $('.share').fadeIn();
            })
        },
        closeShare: function () {
            $('.share').on('click', function () {
                $(this).fadeOut();
            })
        },
        showReviewPoint: function () {
            $('#showReviewPoint').on('click', function () {
                $('#reviewPoint').fadeIn();
            })
            $('#hideReviewPoint').on('click', function () {
                $('#reviewPoint').fadeOut();
            })
        },
        showCurrentPoint: function () {
            $('#showCurrentPoint').on('click', function () {
                $('#currentPoint').fadeIn();
            })
            $('#hideCurrentPoint').on('click', function () {
                $('#currentPoint').fadeOut();
            })
        },
        reviewPointVideo: function () {
            var _this = this;
            var player;
            $('.show-video').on('click', function () {
                var vid = $(this).attr('data-vid');
                console.log(vid)
                player = new Txplayer({
                    containerId: 'vide-content',
                    vid: vid,
                     _this._w,
                    height: _this.videoHeight
                });
                $('.modal-video').fadeIn();
            })
            $('.close-modal').on('click', function () {
                $('.modal-video').fadeOut();
                $('#vide-content').empty();
            })
        }
    }
    
    $(document).ready(function () {
        $('body').on('touchmove', function (event) {
        });
        meet.init();
    });
    

      

  • 相关阅读:
    Combox小问题
    数据库登录名,用户,角色以及权限分配
    UDP初识
    AJax 无刷新构建DataTable
    批量修改数据库构架SQL
    Jquery Ajax
    Linq中使用Group By
    对象的消息模型
    P2P网络技术概览与实现原理
    ajax(1)
  • 原文地址:https://www.cnblogs.com/yanyiyi/p/8087037.html
Copyright © 2011-2022 走看看