熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

js代碼-鼠標劃過時整行變色

2022-06-13   來源: JSP教程 

  <!DOCTYPE HTML PUBLIC "//WC//DTD HTML Transitional//EN"> <html> <head> <script> function overIt(){ var the_obj = eventsrcElement; if(the_objtagNametoLowerCase() == "td"){ the_obj=the_objparentElement; the_objoBgc=the_objcurrentStylebackgroundColor; the_objoFc=the_objcurrentStylecolor; the_objstylebackgroundColor=#BAF; the_objstylecolor=; } } function outIt(){ var the_obj = eventsrcElement; if(the_objtagNametoLowerCase() == "td"){ the_obj=the_objparentElement; the_objstylebackgroundColor=the_objoBgc; the_objstylecolor=the_objoFc; the_objstyletextDecoration=; } } </script> </head> <body> <table border= width= onmouseover="overIt()" onmouseout="outIt()"> <tr bgColor=#> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgColor=#> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgColor=#> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgColor=#> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td></tr> <tr bgColor=#> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> </table> </body> </html>


From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19898.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.