This commit is contained in:
zyronon 2021-09-24 00:03:22 +08:00
parent f905a3521b
commit 7b849f62be
2 changed files with 40 additions and 13 deletions

View File

@ -41,6 +41,8 @@
<script crossorigin="anonymous" <script crossorigin="anonymous"
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js"></script> src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js"></script>
<script src="./jquery.danmu.min.js"></script>
</head> </head>
<body> <body>
<noscript> <noscript>

View File

@ -85,6 +85,7 @@
</div> </div>
</div> </div>
</div> </div>
<div id="danmu"></div>
</div> </div>
</template> </template>
@ -111,20 +112,44 @@ export default {
}, },
mounted() { mounted() {
nextTick(() => { nextTick(() => {
$("#danmu").danmu({
height: 360, //
width: 300, //
zindex :100, //z-index
speed:7000, //672
sumTime:65535, //
danmuLoop:false, //
defaultFontColor:"#FFFFFF", //
fontSizeSmall:16, //
FontSizeBig:24, //
opacity:"0.9", //
topBottonDanmuTime:6000, //
SubtitleProtection:false, //
positionOptimize:false, //AB
let page = new Dom('.LivePage') maxCountInScreen: 40, //,,
console.log(page) maxCountPerSec: 10 //,,
});
setInterval(() => { $("#danmu").danmu("addDanmu",[
{ text:"这是滚动弹幕" ,color:"white",size:1,position:0,time:2}
let template = `<div class="barrage"> ,{ text:"这是顶部弹幕" ,color:"yellow" ,size:1,position:1,time:3}
<div class="type">管理</div> ,{ text:"这是底部弹幕" , color:"red" ,size:1,position:2,time:3}
<div class="text">感谢老铁送的火箭</div> ])
</div>` $('#danmu').danmu('danmuStart');
let barrage = new Dom().create(template) //
console.log(barrage) // let page = new Dom('.LivePage')
page.append(barrage) // console.log(page)
}, 1000) //
// setInterval(() => {
//
// let template = `<div class="barrage">
// <div class="type"></div>
// <div class="text"></div>
// </div>`
// let barrage = new Dom().create(template)
// console.log(barrage)
// page.append(barrage)
// }, 1000)
}) })
}, },
methods: { methods: {