【发布时间】:2019-04-06 05:35:29
【问题描述】:
所以我有一个用 javascript 制作的移动背景,现在我想拉伸我的背景。我使用并搜索了很多方法,但找不到任何解决方案。它不会向我显示文本(它在背景后面)并且图片保持静态。
我已经尝试过那些有背景的解决方案:例如封面。
这是我的背景图片的css代码。
#section1 {
height: 100%;
width: 100%;
position: absolute;
background-attachment: fixed;
background-image: url("../IMG/Background.png");
}
也许这对手头的问题也很有用,但我已经有这个工作了。
var i=1;
function move(){
i++;
document.getElementById("section1").style.backgroundPosition=i+"px";
}
window.onload = function(){
var move1 = setInterval(move, 30);
}
【问题讨论】:
标签: javascript html css