<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    一個表格特效的JS代碼(收藏)

    Posted on 2007-03-22 14:58 Jaunt 閱讀(1066) 評論(0)  編輯  收藏 所屬分類: JavaScript

    嘿嘿……今天看到很好用的一個js表格效果,有時間研究下^_^
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>mytable</title>
    <script language="JavaScript">
    ?// src="anole.js"
    // about this: javapig修改 源自 忘了。
    // Date: 2006-04-29
    ?
    ?function anole(
    ?str_tableid, // table id
    ? num_header_offset,// 表頭行數
    ? str_odd_color, // 奇數行的顏色
    ? str_even_color,// 偶數行的顏色
    ? str_mover_color, // 鼠標經過行的顏色
    ? str_onclick_color // 選中行的顏色
    ? )? {

    ?// 表格ID參數驗證
    ? if(!str_tableid) return alert(str_tableid+"表格不存在");
    ?var obj_tables=(document.all ? document.all[str_tableid]:document.getElementById(str_tableid));
    ?if(!obj_tables) return alert("ID為("+str_tableid+")不存在!");

    ?// 設置個參數的缺省值
    ? var col_config=[];
    ?col_config.header_offset=(num_header_offset?num_header_offset:0 );
    ?col_config.odd_color=(str_odd_color?str_odd_color:'#ffffff');
    ?col_config.even_color=(str_even_color?str_even_color:'#dbeaf5');
    ?col_config.mover_color=(str_mover_color?str_mover_color:'#6699cc');
    ?col_config.onclick_color=(str_onclick_color?str_onclick_color:'#4C7DAB');
    ?// 初始化表格(可能多個表格用同一個ID)
    ? if(obj_tables.length)
    ? for(var i=0;i<obj_tables.length;i++ )
    ?tt_init_table(obj_tables[i],col_config);
    ?else
    ?tt_init_table(obj_tables,col_config);
    }
    ?
    ?function tt_init_table(obj_table,col_config)? {
    ?var col_lconfig=[],
    ?col_trs=obj_table.rows;
    ?if(!col_trs) return ;
    ?
    ?for(var i=col_config.header_offset;i<col_trs.length;i++)? { // i 從 表頭以下開始
    ? col_trs[i].config=col_config;
    ?col_trs[i].lconfig=col_lconfig;
    ?col_trs[i].set_color=tt_set_color;
    ?col_trs[i].onmouseover=tt_mover;
    ?col_trs[i].onmouseout=tt_mout;
    ?col_trs[i].onmousedown=tt_onclick;
    ?col_trs[i].order=(i-col_config.header_offset)%2 ;
    ?col_trs[i].onmouseout();
    ?}
    }
    ?function tt_set_color(str_color) {
    ?this.style.backgroundColor=str_color;
    }
    ?
    ?// 事件操作
    ?function tt_mover() {
    ?if(this.lconfig.clicked!=this )
    ? this.set_color(this.config.mover_color);
    }
    ?function tt_mout() {
    ?if(this.lconfig.clicked!=this )
    ? this.set_color(this.order?this.config.odd_color:this.config.even_color);
    }
    ?function tt_onclick()? {
    ?if( this.lconfig.clicked==this) {
    ? this.lconfig.clicked=null;
    ? this.onmouseover();
    ?}
    ? else {
    ? var last_clicked=this.lconfig.clicked;
    ? this.lconfig.clicked=this ;
    ? if(last_clicked) last_clicked.onmouseout();
    ? this.set_color(this.config.onclick_color);
    ?}
    }
    ?
    </script>
    </head>

    <body>
    <table bgcolor="#9933ff" align="center" cellpadding="1" cellspacing="0" width="80%">
    ?<tr>
    ?<td>
    ?<table id="demo" cellpadding="1" cellspacing="1" border="0" width="100%" align="center">
    ?<tr><th colspan="2" bgcolor="ffffff">HTML document object properties</th></tr>
    ?<tr><td width="20%">activeElement</td><td>Retrieves the object that has the focus.</td></tr>
    ?<tr><td>aLinkColor</td><td>Sets or retrieves the color of all links in the document.</td></tr>
    ?<tr><td>bgColor</td><td>Sets or retrieves the background color behe document object.</td></tr>
    ?<tr><td>body</td><td>Specifies the beginning and end of the document body.</td></tr>
    ?<tr><td>contentEditable</td><td>Sets or retrieves whether the userdocument object.</td></tr>
    ?<tr><td>cookie</td><td>Sets or retrieves the string value of a cookie.</td></tr>
    ?<tr><td>defaultCharset</td><td>Sets or retrieves the default chara of the document.</td></tr>
    ?<tr><td>designMode</td><td>Sets or retrieves whether the document can be edited.</td></tr>
    ?<tr><td>documentElement</td><td>Retrieves a reference to the root node of the document.</td></tr>
    ?<tr><td>domain</td><td>Sets or retrieves the security domain of the document.</td></tr>
    ?</table>
    ?</td>
    ?</tr>
    ?</table>
    ?<script language="JavaScript">
    ? anole('demo',1,'#ffffff','#ccccff','#ffccff','#cc99ff');
    ?</script>
    </body>
    </html>

    From Index:http://www.cnitblog.com/yemoo/archive/2006/06/16/12362.html

    主站蜘蛛池模板: 又大又硬又爽又粗又快的视频免费| 无码日韩人妻AV一区免费l | 日本一区免费电影| 亚洲中文字幕一二三四区| 亚洲精品免费网站| 亚洲国产系列一区二区三区| AA免费观看的1000部电影| 亚洲一卡一卡二新区无人区| 特级做A爰片毛片免费69| 亚洲综合av一区二区三区不卡| 青春禁区视频在线观看直播免费| 中国china体内裑精亚洲日本| 永久免费视频v片www| 国产亚洲Av综合人人澡精品| 亚洲人成网站在线观看青青| 国产免费内射又粗又爽密桃视频| 人人狠狠综合久久亚洲88| 午夜免费福利小电影| 亚洲an日韩专区在线| 午夜免费不卡毛片完整版| 老司机免费午夜精品视频| 国产亚洲精品AA片在线观看不加载 | 国产麻豆免费观看91| 曰批全过程免费视频观看免费软件| 久久久久亚洲AV综合波多野结衣 | 国产va免费精品| 亚洲国产一区国产亚洲| 免费大片黄在线观看yw| 美女被爆羞羞网站在免费观看| 亚洲中文字幕无码一区| 亚洲美女免费视频| 国产亚洲福利精品一区二区| 亚洲中文字幕日产乱码高清app| 久久久久久AV无码免费网站| 亚洲久悠悠色悠在线播放| 免费大黄网站在线观看| 无码av免费网站| 亚洲国产成人久久一区二区三区| 亚洲中文字幕久久精品无码喷水 | 亚洲美日韩Av中文字幕无码久久久妻妇| 免费国产污网站在线观看|