向上滚动文字

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!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>
  <style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
}
-->
</style>
</head>
<body>
  <div id=demo
   style="overflow: hidden; width: 156; color: #ffffff; height: 200px;">
   <table width="156" border=0 align=left cellpadding=0 cellspace=0>
    <tr>
     <td id=demo1 valign=top>
      <table width="160" border=0 cellpadding=0 cellspacing=0>
       <tr>
        <td valign="top">
         <!--gt-->
         <table width="161" border="0" cellpadding="0" cellspacing="0"
          class="text">
          <tr>
           <td width="161">
            <div align="center">
             <p class="text13">
              <font color="#000000">山城重庆的风景名胜 榕树dfdfs</font>
             </p>
            </div>
           </td>
          </tr>
         </table>
         <table width="156" border="0" cellpadding="0" cellspacing="0"
          class="text">
          <tr>
           <td>
            <div align="center">
             <p class="text13">
              <font color="#000000">山城重庆的风景名胜 榕树</font>
             </p>
            </div>
           </td>
          </tr>
         </table>
         <table width="156" border="0" cellpadding="0" cellspacing="0"
          class="text">
          <tr>
           <td>
            <div align="center">
             <p class="text13">
              <font color="#000000">山城重庆的风景名胜 榕树</font>
             </p>
            </div>
           </td>
          </tr>
         </table>
         <table width="156" border="0" cellpadding="0" cellspacing="0"
          class="text">
          <tr>
           <td>
            <div align="center">
             <p class="text13">
              <font color="#000000">山城重庆的风景名胜 榕树</font>
             </p>
            </div>
           </td>
          </tr>
         </table>
         <table width="156" border="0" cellpadding="0" cellspacing="0"
          class="text">
          <tr>
           <td>
            <div align="center">
             <p class="text13">
              <font color="#000000">山城重庆的风景名胜 榕树</font>
             </p>
            </div>
           </td>
          </tr>
         </table>
         <table width="156" border="0" cellpadding="0" cellspacing="0"
          class="text">
          <tr>
           <td>
            <div align="center">
             <p class="text13">
              <font color="#000000">山城重庆的风景名胜 榕树</font>
             </p>
            </div>
           </td>
          </tr>
         </table>
         <table width="156" border="0" cellpadding="0" cellspacing="0"
          class="text">
          <tr>
           <td>
            <div align="center">
             <p class="text13">
              <font color="#000000">山城重庆的风景名胜 榕树</font>
             </p>
            </div>
           </td>
          </tr>
         </table>
         <!--juyjhyjyj-->
        </td>
       </tr>
      </table>
     </td>
    <tr>
     <td id=demo2 valign=top></td>
    </tr>
   </table>
  </div>
  <script>  
  var   speed=80  
  demo2.innerHTML=demo1.innerHTML  
  function   Marquee(){  
  if(demo2.offsetTop-demo.scrollTop<=0)  
  demo.scrollTop-=demo1.offsetHeight  
  else{  
  demo.scrollTop++  
  }  
  }  
  var   MyMar=setInterval(Marquee,speed)  
  demo.onmouseover=function()   {clearInterval(MyMar)}  
  demo.onmouseout=function()   {MyMar=setInterval(Marquee,speed)}  
  </script>
</body>
</html>


你可能感兴趣的:(html,XHTML)