pra*_*pal 65 html javascript marquee
实际上我正试图在另一个盒子里移动一些盒子.我使它工作,但两个块不会互相打断.我该怎么办?如何让这些块相互交叉?我尝试使用style:position,但它不起作用.
这是我一直在使用的代码:
<marquee direction="down" behavior="alternate" scrollAmount=10 style="border:2px solid blue;">
<marquee behavior="alternate" scrollAmount=50 >
<img src="img1.JPG">
</marquee>
<marquee behavior="alternate" scrollAmount=10 >
<img src="img1.JPG">
</marquee>
</marquee>
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
bob*_*nce 69
哦,亲爱的主啊!
好.它们不会交叉,因为它们静态地位于另一个之上.第二个选框不能超过第一个选框.
你可以通过使用绝对定位来解开彼此的marquees来解决这个问题.然后用不同的水平和垂直运动双重嵌套:
<div style="border:2px solid blue; position: relative;">
<marquee direction="down" behavior="alternate" scrollAmount="10">
<marquee behavior="alternate" scrollAmount="50"><img src="img1.jpeg" alt="oh no" /></marquee>
</marquee>
<marquee direction="down" behavior="alternate" scrollAmount="20" style="position: absolute; top: 0;">
<marquee behavior="alternate" scrollAmount="10"><img src="img1.jpeg" alt="help meee" /></marquee>
</marquee>
</div>
Run Code Online (Sandbox Code Playgroud)
*:对于'解决'的值'x',其中x ='制造一个可怕的混乱'.
这仅用于说明目的.请不要使用它.
Bai*_*ose 51
请不要使用marquee标签,它是非标准的并且已弃用.对于任何类型的动画,都可以使用jQuery UI之类的JavaScript库.