主题:门外汉求助
连续向左滚动文字
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<BODY>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>连续向左滚动文字效果</title>
<style type="text/css">
<!--
body {
margin-top: 0px;
}
a {
font-family: 黑体;
color: #FF0000;
font-size: medium;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #FF0000;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
color: #FF0000;
}
-->
</style>
</head>
<body>
<div id="marquees">
<a href="http://www.google.com" target="_blank">江都</a>
<a href="http://www.baidu.com" target="_blank">扬州市</a>
<a href="http://www.sina.com" target="_blank">江都郑州</a>
</div>
<div id="templayer" style="position:absolute;left:0;top:0;visibility:hidden"></div>
<script language="JavaScript">
marqueesWidth=950;
with(marquees){
style.height=0;
style.width=marqueesWidth;
style.overflowX="hidden";
style.overflowY="visible";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
preLeft=0; currentLeft=0; stopscroll=false;
function init(){
templayer.innerHTML="";
while(templayer.offsetWidth<marqueesWidth){
templayer.innerHTML+=marquees.innerHTML;
}
marquees.innerHTML+=templayer.innerHTML;
setInterval("scrollLeft()",10);
}init();
function scrollLeft(){
if(stopscroll==true) return;
preLeft=marquees.scrollLeft;
marquees.scrollLeft+=1;
if(preLeft==marquees.scrollLeft){
marquees.scrollLeft=templayer.offsetWidth-marqueesWidth+1;
}
}
</script>
</body>
</html>
</BODY>
</HTML>
字幕由右边滚出时有留白,如果修改能让文字从最右边滚出。
求大侠不啬指教.
marqueesWidth=950;改这个咋就没效呢?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<BODY>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>连续向左滚动文字效果</title>
<style type="text/css">
<!--
body {
margin-top: 0px;
}
a {
font-family: 黑体;
color: #FF0000;
font-size: medium;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #FF0000;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
color: #FF0000;
}
-->
</style>
</head>
<body>
<div id="marquees">
<a href="http://www.google.com" target="_blank">江都</a>
<a href="http://www.baidu.com" target="_blank">扬州市</a>
<a href="http://www.sina.com" target="_blank">江都郑州</a>
</div>
<div id="templayer" style="position:absolute;left:0;top:0;visibility:hidden"></div>
<script language="JavaScript">
marqueesWidth=950;
with(marquees){
style.height=0;
style.width=marqueesWidth;
style.overflowX="hidden";
style.overflowY="visible";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
preLeft=0; currentLeft=0; stopscroll=false;
function init(){
templayer.innerHTML="";
while(templayer.offsetWidth<marqueesWidth){
templayer.innerHTML+=marquees.innerHTML;
}
marquees.innerHTML+=templayer.innerHTML;
setInterval("scrollLeft()",10);
}init();
function scrollLeft(){
if(stopscroll==true) return;
preLeft=marquees.scrollLeft;
marquees.scrollLeft+=1;
if(preLeft==marquees.scrollLeft){
marquees.scrollLeft=templayer.offsetWidth-marqueesWidth+1;
}
}
</script>
</body>
</html>
</BODY>
</HTML>
字幕由右边滚出时有留白,如果修改能让文字从最右边滚出。
求大侠不啬指教.
marqueesWidth=950;改这个咋就没效呢?