实际上,我正在尝试将一些盒子交替移动到另一个盒子中。我让它工作了,但两个块都不会互相干扰。我该怎么办?我怎样才能使这些块相互交叉?我尝试使用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>我做错了什么?
发布于 2009-01-19 13:24:31
哦,天哪!
井。它们不会交叉,因为它们是静态地一个位于另一个之上。第二个选取框不能高于第一个选取框。
您可以通过使用绝对定位使选取框彼此分离来解决此问题。然后以不同的水平和垂直运动对每一个进行双重嵌套:
<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>*:对于'solve‘的值'x’,其中x='make a hideous of‘。
这仅用于说明目的。请不要使用这个。
发布于 2009-01-19 07:48:31
请不要使用marquee标签,它是非标准的并且已被弃用。对于任何类型的动画,都可以使用像jQuery UI这样的JavaScript库。
发布于 2009-01-19 08:25:17
使用JavaScript库,如果没有,使用JavaScript的settimeout加上绝对定位& dhmtl。
https://stackoverflow.com/questions/456815
复制相似问题