当我运行此javascript时,我得到:Use of Mutation Events is deprecated. Use MutationObserver instead.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>AudioPlayer</title>
</head>
<body>
<div id="Player"></div>
<script>
function Player() {
this.width = '100%';
this.height = '10px';
this.family = 'toma';
this.size = '10px';
this._bg = '#00000';
this.titleContainerWidth = '100px';
this.alignText = 'center';
this.titleMargin = '0 auto';
this.titleText = 'THI IS THE TITLE';
this.color = '#29FFFF';
this.id = 'Player';
this.autoplay = false;
this.pl = document.getElementById(this.id);
this.cadd = function(element) {
var elemnt = document.createElement(element);
this.pl.appendChild(elemnt);
return elemnt
}
this._make = function() {
var title = this.cadd('p');
title.style.fontFamily = this.family;
title.style.fontSize = this.size;
title.style.textAlign = this.alignText;
title.style.color = this.color;
title.style.width = this.titleContainerWidth;
title.style.margin = this.titleMargin;
title.innerHTML = "<marquee behavior='scrolling' speed='1' loop='true'>" + this.titleText + "</marquee>";
this.pl.style.width = this.width;
this.pl.style.background = this._bg;
}
}
player = new Player();
player._make();
</script>
</body>
</html>
这是什么意思?我只是猜测这就是为什么背景不会显示div id的原因。但是,我不确定。可能是我在javascript或标题中调用div的方式吗?
答案 0 :(得分:0)
CSS十六进制颜色的哈希后跟三个或六个字符。你的有五个。