本文实例讲述了JS实现网页表格自动变大缩小的方法。分享给大家供大家参考。具体分析如下: 这就是一个个性的动态表格效果代码,网页中的表格自动放大或者缩小,不停的变化 主要就是一个强调显示的作用 复制代码 代码如下: js会动的表格 .cellstyle {<br> COLOR: #ffffff; FONT-FAMILY: Times; FONT-SIZE: 11pt; FONT-WEIGHT: bold<br> }<br> A {<br> COLOR: #ff0000; TEXT-DECORATION: none<br> }<br> A:hover {<br> COLOR: #ff8888; TEXT-DECORATION: underline<br> }<br> <br> var i_bordercolor=0<br> var i_bordercolorlight=10<br> var i_bordercolordark=20<br> var v_bordercolor=1<br> var v_bordercolorlight=1<br> var v_bordercolordark=1<br> var textcolor= new Array()<br> textcolor[0] ="FFFFFF"<br> textcolor[1] ="FFF8F8"<br> textcolor[2] ="FFF0F0"<br> textcolor[3] ="FFD8D8"<br> textcolor[4] ="FFD0D0"<br> textcolor[5] ="FFC8C8"<br> textcolor[6] ="FFC0C0"<br> textcolor[7] ="FFB8B8"<br> textcolor[8] ="FFB0B0"<br> textcolor[9] ="FFA8A8"<br> textcolor[10] ="FFA0A0"<br> textcolor[11] ="FF9898"<br> textcolor[12] ="FF9090"<br> textcolor[13] ="FF8888"<br> textcolor[14] ="FF8080"<br> textcolor[15] ="FF7878"<br> textcolor[16] ="FF7070"<br> textcolor[17] ="FF6868"<br> textcolor[18] ="FF6060"<br> textcolor[19] ="FF5858"<br> textcolor[20] ="FF5050"<br> textcolor[21] ="FF4848"<br> textcolor[22] ="FF4040"<br> textcolor[23] ="FF3838"<br> textcolor[24] ="FF3030"<br> textcolor[25] ="FF2828"<br> textcolor[26] ="FF2020"<br> textcolor[27] ="FF1818"<br> textcolor[28] ="FF1010"<br> textcolor[29] ="FF0808"<br> textcolor[30] ="FF0000"<br> function checkbrowser() {<br> if (document.layers) {<br> alert("This script requires Internet Explorer 4 or higher. Sorry folks!")<br> }<br> if (document.all) {<br> bordercolor()<br> }<br> }<br> function bordercolor() { <br> if (i_bordercolor >= textcolor.length-1) {v_bordercolor*=-1}<br> if (i_bordercolor <= 0) {v_bordercolor*=-1}<br /> if (i_bordercolordark >= textcolor.length-1) {v_bordercolordark*=-1}<br> if (i_bordercolordark <= 0) {v_bordercolordark*=-1}<br /> if (i_bordercolorlight >= textcolor.length-1) {v_bordercolorlight*=-1}<br> if (i_bordercolorlight <= 0) {v_bordercolorlight*=-1}<br /> document.all.cellone.borderColor=textcolor[i_bordercolor]<br /> document.all.cellone.borderColorDark=textcolor[i_bordercolordark]<br /> document.all.cellone.borderColorLight=textcolor[i_bordercolorlight]<br /> document.all.cellone.border=i_bordercolorlight*2<br /> i_bordercolor =v_bordercolor<br /> i_bordercolordark =v_bordercolordark<br /> i_bordercolorlight =v_bordercolorlight<br /> var timer=setTimeout("bordercolor()",100)<br /> }<br /> http://www.jb51.net 希望本文所述对大家的javascript程序设计有所帮助。