15年软件开发经验 只做源码定制 互联网+定制化解决方案

15年软件开发经验,只做源码定制!

原创设计 定制开发

满足您的个性化需求

当前位置:首页 前端开发 CSS

表格向上滚动 表格滚动

孙正萌| 发布于 2022-05-26 18:25:50| 520阅读| 0点赞| 0评论
举报

js表格向上滚动。头部固定



<form>
      <table width="480" height="33" border="1" bordercolor="#f8727e" class="hb" >
        <tr>
          <td width="105" align="center" valign="middle" bgcolor="#f8727e"><span class="STYLE19">准考证 span>td>
          <td width="55" align="center" valign="middle" bgcolor="#f8727e"><span class="STYLE19">姓名span>td>
          <td width="75" align="center" valign="middle" bgcolor="#f8727e"><span class="STYLE19">考生身份span>td>
          <td width="85" align="center" valign="middle" bgcolor="#f8727e"><span class="STYLE19">报考类别span>td>
          <td width="135" align="center" valign="middle" bgcolor="#f8727e"><span class="STYLE19">取证情况span>td>
        tr>
      table>
      <div id="A1" style="height:358px;">
        <div id="A2">
          <table width="480" height="258" border="1" bordercolor="#f8727e" class="hb" >
            <tr>
              <td width="105" align="center" valign="middle"><span class="STYLE27">315214****900span>td>
              <td width="55" align="center" valign="middle"><span class="STYLE27">陈*span>td>
              <td width="75" align="center" valign="middle"><span class="STYLE27">在校span>td>
              <td width="85" align="center" valign="middle"><span class="STYLE27">高中span>td>
              <td width="135" align="center" valign="middle"><span class="STYLE27">取得教师资格证span>td>
            tr>
            <tr>
              <td align="center" valign="middle"><span class="STYLE27">315214****502span>td>
              <td align="center" valign="middle"><span class="STYLE27">张**span>td>
              <td align="center" valign="middle"><span class="STYLE27">在校span>td>
              <td align="center" valign="middle"><span class="STYLE27">初中span>td>
              <td align="center" valign="middle"><span class="STYLE27">取得教师资格证span>td>
            tr>
            <tr>
              <td align="center" valign="middle"><span class="STYLE27">315214****652span>td>
              <td align="center" valign="middle"><span class="STYLE27">江**span>td>
              <td align="center" valign="middle"><span class="STYLE27">在校span>td>
              <td align="center" valign="middle"><span class="STYLE27">初中span>td>
              <td align="center" valign="middle"><span class="STYLE27">取得教师资格证span>td>
            tr>
            <tr>
              <td align="center" valign="middle"><span class="STYLE27">315214****083span>td>
              <td align="center" valign="middle"><span class="STYLE27">金**span>td>
              <td align="center" valign="middle"><span class="STYLE27">在校span>td>
              <td align="center" valign="middle"><span class="STYLE27">初中span>td>
              <td align="center" valign="middle"><span class="STYLE27">取得合格证明span>td>
            tr>
          table>
        div>
      div>
    form>


<script language=JavaScript>	
	function _InitScroll(_S1,_S2,_W,_H,_T){
		return "var marqueesHeight"+_S1+"="+_H+";var stopscroll"+_S1+"=false;var scrollElem"+_S1+"=document.getElementById('"+_S1+"');with(scrollElem"+_S1+"){style.width="+_W+";style.height=marqueesHeight"+_S1+";style.overflow='hidden';noWrap=true;}scrollElem"+_S1+".onmouseover=new Function('stopscroll"+_S1+"=true');scrollElem"+_S1+".onmouseout=new Function('stopscroll"+_S1+"=false');var preTop"+_S1+"=0; var currentTop"+_S1+"=0; var stoptime"+_S1+"=0;var leftElem"+_S2+"=document.getElementById('"+_S2+"');scrollElem"+_S1+".appendChild(leftElem"+_S2+".cloneNode(true));setTimeout('init_srolltext"+_S1+"()',"+_T+");function init_srolltext"+_S1+"(){scrollElem"+_S1+".scrollTop=0;setInterval('scrollUp"+_S1+"()',50);}function scrollUp"+_S1+"(){if(stopscroll"+_S1+"){return;}currentTop"+_S1+"+=1;if(currentTop"+_S1+"==(marqueesHeight"+_S1+"+1)) {stoptime"+_S1+"+=1;currentTop"+_S1+"-=1;if(stoptime"+_S1+"=="+_T/50+") {currentTop"+_S1+"=0;stoptime"+_S1+"=0;}}else{preTop"+_S1+"=scrollElem"+_S1+".scrollTop;scrollElem"+_S1+".scrollTop +=1;if(preTop"+_S1+"==scrollElem"+_S1+".scrollTop){scrollElem"+_S1+".scrollTop=0;scrollElem"+_S1+".scrollTop +=1;}}}";
	}
	eval(_InitScroll("A1","A2",550,19*6,1000));
script>


0

0条评论

别默默看啦~登录/注册一起参与讨论吧~

热门标签

孙正萌
微信扫一扫立即咨询
账号登录|扫码登录

立即注册 |忘记密码?

欢迎注册

已有账号马上登录

重置密码

扫码绑定微信
微信扫一扫

绑定手机号

分享到-微信

举报

  • 举报类型:

  • 举报描述:

您好,当前积分不足。

在线客服
拨打电话
17330196230 13230981129
顶部