原声JS制作静态页面的弹幕效果,代码如下
var barrageBox = document.querySelector('.barrage-box');
var wWidth = window.innerWidth > 640 ? 640 : window.innerWidth;
var during = parseInt(wWidth / 640 * 20000);
var positionX = parseInt(3.5 * (wWidth / 640) * 100);
var index = 0;
var text = ['123123',
'666','必须的啊',
'废话吗?',
'sss','abcdef'
];
var query=function(elem){
var elem = elem,
f=j=0,callback,_this={},
tween=funct