日期:2014-05-17  浏览次数:20512 次

Marquee如何在一出现时靠上或靠左的实现办法问题?
测试时,点“停止并设置”按钮,marquee靠上或靠左了。如何不用点击此按钮就实现这个按钮的功能呢?


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<MARQUEE id=m1 direction=up style="border-width:2px;border-style:solid;"
width=200 height=200>向上</MARQUEE><BR>

<!-- 单击此按钮可在字幕滚动时读取 scrollLeft 和 scrollTop 属性的值。 -->

<BUTTON onclick="alert('scrolltop: ' + m1.scrollTop + ' scrollLeft: ' + m1.scrollLeft)">读取</BUTTON>
<!-- 当字幕停止时,你可以设置水平字幕的 scrollLeft,或者设置垂直字幕的 scrollTop。 -->
<BUTTON onclick="m1.stop();m1.scrollTop = m1.height;m1.scrollLeft = m1.width;">停止并设置 靠左或置顶</BUTTON>
<BUTTON onclick="m1.start();">开始</BUTTON>
</body>
</html>


------解决方案--------------------
让它从上往下滚呗!
------解决方案--------------------
用JS可以解决的, 百度搜索一下吧, 很多代码的
------解决方案--------------------
引用楼主 bihoo88 的帖子:
测试时,点“停止并设置”按钮,marquee靠上或靠左了。如何不用点击此按钮就实现这个按钮的功能呢?


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档 </title>
</head>

<body…