一个 iframe 浮动帧:
<head>
<STYLE type=text/css>
.123 {
FONT-SIZE: 12px; COLOR: #000000; TEXT-DECORATION: none;line-height: 20px;
}
A.123:link {
COLOR: #000000
}
A.123:visited {
COLOR: #000000
}
A.123:hover {
COLOR: #e30030
}
</STYLE><script language=javascript src="roll.js"></script>
<script language="JavaScript1.2">var scrollerwidth=150
var scrollerheight=80
var scrollerbgcolor='white'i=0
if (messages.length>2)
{
// i=1
  i1=1;
  i=2
}
else if(messages.length==2)
{
  i1=1;
  i=0
}
else
{
i1=0
}
function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.top>0&&tlayer.top<=5){
tlayer.top=0
setTimeout("move1(tlayer)",3000)
setTimeout("move2(document.main.document.second)",3000)
return
}
if (tlayer.top>=tlayer.document.height*-1){
tlayer.top-=5
setTimeout("move1(tlayer)",100)
}
else{
tlayer.top=scrollerheight
tlayer.document.write(messages[i])
tlayer.document.close()
if (i>=messages.length-1)
i=0
else
i++
}
}function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.top>0&&tlayer2.top<=5){
tlayer2.top=0
setTimeout("move2(tlayer2)",3000)
setTimeout("move1(document.main.document.first)",3000)
return
}
if (tlayer2.top>=tlayer2.document.height*-1){
tlayer2.top-=5
setTimeout("move2(tlayer2)",100)
}
else{
tlayer2.top=scrollerheight
tlayer2.document.write(messages[i])
tlayer2.document.close()
if (i>=messages.length-1)
i=0
else
i++
}
}function move3(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
tdiv.style.pixelTop=0
setTimeout("move3(tdiv)",3000)
setTimeout("move4(second2)",3000)
return
}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=5
setTimeout("move3(tdiv)",100)
}
else{
tdiv.style.pixelTop=scrollerheight
tdiv.innerHTML=messages[i]
if (i>=messages.length-1)
i=0
else
i++
}
}function move4(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
tdiv2.style.pixelTop=0
setTimeout("move4(tdiv2)",3000)
setTimeout("move3(first2)",3000)
return
}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=5
setTimeout("move4(second2)",100)
}
else{
tdiv2.style.pixelTop=scrollerheight
tdiv2.innerHTML=messages[i]
if (i>=messages.length-1)
i=0
else
i++
}
}function startscroll(){
if (document.all){
move3(first2)
second2.style.top=scrollerheight
}
else if (document.layers){
move1(document.main.document.first)
document.main.document.second.top=scrollerheight+5
document.main.document.second.visibility='show'
}
}
window.onload=startscroll
</script>
      <ilayer id="main" width=&{scrollerwidth}; height=&{scrollerheight}; bgcolor=&{scrollerbgcolor};> 
<title></title>
</head>
<body topmargin="10" leftmargin="15">
      <layer id="first" left=0 top=1 width=&{scrollerwidth};> 
      <script language="JavaScript1.2">
if (document.layers)
document.write(messages[0])
      </script>
      </layer>
      <layer id="second" left=0 top=0 width=&{scrollerwidth}; visibility=hide> 
      <script language="JavaScript1.2">
if (document.layers)
document.write(messages[i1])
      </script>
      </layer>
      </ilayer>
      <script language="JavaScript1.2">
if (document.all){
document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+'">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">')
document.write(messages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0">')
document.write(messages[i1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</span>')
}
      </script>
</body>

解决方案 »

  1.   

    直接用frontpage里面的滚动字幕,简单适用!!
      

  2.   

    meizz(梅花雨):为什么不好用?我也试过把原文件粘在dreamweaver里,但不好用,你试了吗?
    zhjzh_zjz(虚心学习,望多指教):直接用frontpage里面的滚动字幕简单适用但达不到我要的功能。
      

  3.   

    嗬嗬,刚好以前做过一个
    ================================================================================
    <BODY>
    <div class=box>
    <div class=boxA style="position:relative;height:110;overflow:hiden;color:#000000">
    <div style="position:absolute;width:140;height:100;clip:rect(0 140 100 0);left:5;top:5">
    <div id="TipsA" style="position:absolute;width:140;left:0;top:1;text-align:left"></div>
    <div id="TipsB" style="position:absolute;width:140;left:0;top:0;text-align:left"></div>
    </div>
    </div>
    </div>
    <script language="JavaScript">
    var scrollerheight=100
    var messages=new Array()
    var delay=5500
    var tipsIdxmessages[0]="0有一停顿一停顿的效果。谢谢大家。把原码给我好吗?"
    messages[1]="1有一停顿一停顿的效果。谢谢大家。把原码给我好吗?"
    messages[2]="2有一停顿一停顿的效果。谢谢大家。把原码给我好吗?"
    messages[3]="3有一停顿一停顿的效果。谢谢大家。把原码给我好吗?"
    messages[4]="4有一停顿一停顿的效果。谢谢大家。把原码给我好吗?"function scroA(whichdiv){
     tdiv=eval(whichdiv)
     if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
    tdiv.style.pixelTop=0
    setTimeout("scroA(tdiv)",delay)
    setTimeout("scroB(TipsB)",delay)
    return
     }
     if (tdiv.style.pixelTop>= -tdiv.offsetHeight){
    tdiv.style.pixelTop-=5
    setTimeout("scroA(tdiv)",100)
     }
     else{
    tdiv.style.pixelTop=scrollerheight
    tdiv.innerHTML="  " +messages[tipsIdx]
    if (++tipsIdx==messages.length) tipsIdx=0
     }
    }function scroB(whichdiv){
     tdiv2=eval(whichdiv)
     if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
    tdiv2.style.pixelTop=0
    setTimeout("scroB(tdiv2)",delay)
    setTimeout("scroA(TipsA)",delay)
    return
     }
     if (tdiv2.style.pixelTop>=-tdiv2.offsetHeight){
    tdiv2.style.pixelTop-=5
    setTimeout("scroB(TipsB)",100)
     }
     else{
    tdiv2.style.pixelTop=scrollerheight
    tdiv2.innerHTML="  " + messages[tipsIdx]
    if (++tipsIdx>=messages.length) tipsIdx=0
     }
    }tipsIdx= messages.length>2 ? 2:0;
    TipsA.innerHTML="  " +messages[0]
    TipsB.innerHTML="  " +messages[1]
    TipsB.style.top=scrollerheight
    scroA(TipsA)
    </script>
    </BODY>
    ================================================================================
    具体样式你自己改吧
      

  4.   

    大家到这里看看,
    http://www.solarstones.com/wzq/
    我第一次写的,帮我测试一下好吗?
      

  5.   

    javawriter(java菜鸟) :
    倒!
    宽度140,你全部替换不就行了吗?