当前位置:首页>HTML> HTML源码 给网站侧边栏添加随机小姐姐视频模块

HTML源码 给网站侧边栏添加随机小姐姐视频模块

效果图

HTML源码 给网站侧边栏添加随机小姐姐视频模块

源代码

<div>
    <section id="main">
        <video id="player" src="https://dwz.mk/MVZVjy" controls="controls" width="100%" height="400px"></video>
    </section>
</div>
<div style="text-align: center;">
    <section id="buttons">
        <button id="switch">连续: 开</button>
        <button id="next1">换一个</button>
    </section>
</div>
 
<script>
    (function (window, document) {
        if (top != self) {
            window.top.location.replace(self.location.href);
        }
        var get = function (id) {
            return document.getElementById(id);
        }
        var bind = function (element, event, callback) {
            return element.addEventListener(event, callback);
        }
        var auto = true;
        var player = get('player');
        var randomm = function () {
            player.src = 'http://v.nrzj.vip/video.php?_t=' + Math.random();
            player.play();
        }
        bind(get('next1'), 'click', randomm);
        bind(player, 'error', function () {
            randomm();
        });
        bind(get('switch'), 'click', function () {
            auto = !auto;
            this.innerText = '连续: ' + (auto ? '开' : '关');
        });
        bind(player, 'ended', function () {
            if (auto) randomm();
        });
    })(window, document);</script>
<style>
    #switch,#next1{
    background: #7F9CCC;
    color:#fff;
    line-height:40px;
    text-align:center;
    width:100px;
    border:none;
    margin:0 6px;
    border-radius:6px;
    font-weight:bold;
    }
</style>

 

可用接口

https://www.kjdao.org/zb_users/theme/bbs2022/ksxjj.php

http://v.nrzj.vip/video.php

给TA打赏
共{{data.count}}人
人已打赏
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
搜索