由于我在项目上面的首页上需要实现一个弹幕小功能,需要不断显示服务器中返回的数据,这里就记录一下JS的具体实现
以下的代码实现
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>弹幕示例</title>
<style type="text/css">
html,body{
background:#efefef;
height:100%;
}
div.mask{
position:fixed;
width:100%;
height:100px;
/*background:rgba(0,0,0,0.8);*/
opacity:0.5;
bottom:0;
left:0px;
}
div.bottom{
width:100%;
height:77px;
background:linear-gradient(#ccc,#4a4a4a);
position:fixed;
bottom:0px;
left:0px;
text-align:center;
line-height:77px;
}
div.bottom input.content{
width:50%;
min-width: 200px;
height:37px;
bord