<marquee>aa</marquee>实现内容滚动时首尾相连,不出现空白的时候


<HTML>
<HEAD>
</HEAD>
<BODY>


<div id=demo style='overflow:hidden;height:32px;width:809px;'>
<table height='' border=1 cellspacing=0 cellpadding=0>
<td id=demo1>
<!-- 下面是你要显示的内容 -->
<table width=809>
<tr>
<td>1</td><td>2</td><td>3</td><td>3</td><td>3</td><td>3</td><td>3</td><td>3</td><td>3</td><td>3</td>
</tr>
</table>
<!-- 显示的内容结束! -->
</td>
<td id=demo2></td>

</table>
</div>


<script>

var speed=15; //移动速度
demo2.innerHTML=demo1.innerHTML;
function Marquee1(){
if(demo2.offsetWidth-demo.scrollLeft <=0){
demo.scrollLeft-=demo2.offsetWidth;
}else{
demo.scrollLeft++;
}
}
var MyMar=setInterval(Marquee1,speed);
demo.onmouseover=function(){clearInterval(MyMar)}
demo.onmouseout=function(){MyMar=setInterval(Marquee1,speed)}
</script>
</td>
</tr>

</BODY>
</HTML>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
你可以使用HTML的`<input>`标签实现用户输入功能,例如: ``` <div class="danmu"> <marquee behavior="scroll" direction="left" scrollamount="30"><font color="red" size="15px" >树枝666</font></marquee> <marquee behavior="scroll" direction="left" scrollamount="20"><font color="aqua" size="20px">你干嘛~哎呦</font></marquee> <marquee behavior="scroll" direction="left" scrollamount="25"><font>油饼食不食</font></marquee> <marquee behavior="scroll" direction="left" scrollamount="20"><font color="pink" size="10px">贞德士泥鸭</font></marquee> <marquee behavior="scroll" direction="left" scrollamount="28"><font color="red">amagi</font></marquee> <marquee behavior="scroll" direction="left" scrollamount="20"><font color="greenyellow" size="20px">蒸虾头</font></marquee> <marquee behavior="scroll" direction="left" scrollamount="10"><font size="16px" >荔枝,你要我拿什么荔枝</font></marquee> <marquee behavior="scroll" direction="left" scrollamount="15"><font color="pink" size="20px">激尼钛霉</font></marquee> <input type="text" placeholder="请输入弹幕内容" onkeydown="if(event.keyCode==13){sendDanmu();}"> </div> ``` 这里使用了`<input>`标签,并设置了`type="text"`,表示输入框是一个文本输入框。同,还设置了`placeholder`属性来提示用户输入内容。在输入框中按下回车键,调用了一个JavaScript函数`sendDanmu()`,这个函数需要你自己编写,用来将用户输入的内容添加到弹幕中。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值