我正在从下往上此链接JavaScript编码 - >按钮,更改和暂停跑马灯
我现在的问题是,
1)选区就会显示一大堆文字,自动字幕。
2)我想添加一个按钮,其功能为停止滚动字幕和恢复 - 我已经在我的页面。但它不可行,因为它有两个按钮。为了提高效率,我决定添加一个javascrip按钮,一旦它被点击就会改变文本。
3)我尽力修改,但它dosnt工作。任何人都可以帮我纠正这个简单的片段吗?
感谢 -John
<marquee behavior="scroll" direction="up" style="height:500px;" scrollamount="6" id="mymarquee" ><?php echo $price_today; ?></marquee>
<input type="button" value="Stop Marquee" onClick="document.getElementById('mymarquee').stop();"/>
<input type="button" value="Start Marquee" onClick="document.getElementById('mymarquee').start();"/>
<input onclick="change()" type="button" value="Pause Autoscroll" id="myButton1" />
<script type="text/javascript">
function change() // no ';' here
{
var elem = document.getElementById("myButton1");
if (elem.value=="Pause Autoscroll")
elem.value = "Continue Autoscroll";
document.getElementById('mymarquee').stop();
else
elem.value = "Pause Autoscroll";
document.getElementById('mymarquee').start();
}
的Wooo感谢! :) –
很高兴帮助。如果它回答了你的问题,你可以接受它作为答案,以便将来碰到这个问题的其他人会知道这个答案是什么。 PS:从我看过
哈哈,和像我这样的老计时器充满了回忆:p –