• css+jq实现的简单视频播放器效果


    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>无标题文档</title>
    </head>
    
    <body>
    <script src="https://shengpingzhang.oss-accelerate.aliyuncs.com/templets/pc/js/jquery.min.js"></script>
    <div class="video-fl">
    <video controls="controls" poster="index-video-1.jpg" preload="none" src="index-cp-video.mp4"></video>
    <span class="video-play">
    <img src="video-icon.png" alt="">
    </span>
    </div>
    
    <style>
    .video-fl {
    float: left;
    width: 57.3%;
    position: relative;
    }
    .video-fl video {
    width: 100%;
    height: auto;
    }
    .video-play {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 9;
    cursor: pointer;
    }
    .video-play img {
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -36px;
    margin-top: -36px;
    cursor: pointer;
    z-index: 99;
    display: block;
    }
    </style>
    
    <script>
    function videoStop() {
    var Video = $('.index-video video');
    for (var i = 0; i < Video.length; i++) {
    var element = Video[i];
    element.pause();
    }
    }
    $('.video-play').click(function () {
    videoStop();
    var videos = $(this).siblings('video');
    $(this).hide();
    videos[0].play();
    })
    </script>
    </body>
    </html>

    播放器按钮下载:https://files.cnblogs.com/files/xinlvtian/video-icon.zip

  • 相关阅读:
    SQL学习
    设计模式学习之简单工厂
    c#读写操作3
    SQL存储过程学习
    c# xml的读写
    SQL存储过程实例
    存储过程分页
    搞双显示器
    转:用药的七种心理误区
    lp提了一个非常让偶非常郁闷的要求……
  • 原文地址:https://www.cnblogs.com/xinlvtian/p/13858942.html
Copyright © 2020-2023  润新知