Javascript - 错误背景未显示
Javascript - error background not showing
当我运行这个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或标题吗?
CSS 十六进制颜色有一个哈希值,后跟三个或六个字符。你的有五个。
相关文章:
- 使用JS如何动态更改显示的html文件中的文本背景颜色
- 如何在显示侧边栏时禁用背景,单击除侧边栏之外的任何位置都会关闭侧边栏
- 无法在qualtrics上使用javascript显示背景图像
- ASP MVC网站与vegas背景幻灯片不显示背景后发布到服务器
- 地图<区域>未显示背景图像
- 通过图像和 CSS 显示背景网格
- Chrome扩展程序:如何在新选项卡中显示背景图像
- 显示背景图像时出现问题
- 将图像 SRC 存储在 JS 变量中,以便可用于显示背景图像
- 高亮显示背景窗格大于链接对象且没有填充的链接
- 在java脚本的帮助下,在日历中显示背景日期应该是红色的,我也从oracle数据库中获取数据
- 如何在菜单部分滚动后线性显示背景颜色
- 在弹出窗口之前显示背景颜色
- 显示背景图像的位置(http://www..)在文本框HTML JAVASCRIPT
- 引导模式仅显示背景
- 带有Internet Explorer 8的JQuery/CSS不显示背景图像
- 为什么我的页面在移动设备上只显示背景黑屏而不是mp4视频背景
- 画布不显示背景
- 创建指令时不显示背景图像
- 如何确保在加载页面之前显示背景图像