<marquee direction="right" behavior="scroll" scrollamount="10" scrolldelay="200">这是一个滚动字幕。</marquee> 下面的例子显示了 marquee 元素的 scrollLeft 和 scrollTop 属性的一些用途。 <marquee id=m1 direction=right style="border-width:2px;border-style:solid;" width=200 height=200>向右</MARQUEE> <!-- 单击此按钮可在字幕滚动时读取 scrollLeft 和 scrollTop 属性的值。 --> <button onclick="alert('scrollLeft: ' + m1.scrollLeft + ' scrollRight: ' + m1.scrollTop)">读取</button> <!-- 当字幕停止时,你可以设置水平字幕的 scrollLeft,或者设置垂直字幕的 scrollTop。 --> <button onclick="m1.stop();m1.scrollLeft = 190;">停止并设置 scrollLeft=190</button> <button onclick="m1.start();">开始</button> |
|