JS code for a table effects collected

xiaoxiao2021-04-06  290

<

HTML

>

<

HEAD

>

<

Meta

HTTP-Equiv

= "Content-Type"

Content

= "text / html; charSet = GB2312"

>

<

Title

>

MyTable

Title

>

<

Script

Language

= "JavaScript"

>

// src = "anole.js" // About this: JavaPig modification source forgot.

// Date: 2006-04-29 function anole (str_tableid, // Table ID Num_Header_offset, // Metet Route Str_ODD_COLOR, // odd color str_even_color, // 数 的 color str_mover_color, // mouse over line Color str_onclick_color // Select the color of the row) {// Table ID Parameter Verification if (! Str_tableid) Return Alert (STR_TABLEID "table does not exist!"); Var obj_tables = (Document.all? Document.all [str_tableid]: Document .getelementByid (STR_TABLEID)); if (! ") returnous alert (" Str_TableID ") does not exist!"); // Setting the default value of parameters 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 '); // Initialize the table (possibly multiple tables with the same ID) IF (OBJ_ tables.length) for (var i = 0; i

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;} // Event action 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 what 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

>

Specifier 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 retrials the string value of a cookie.

TD

>

TR

>

<

TR

> <

TD

>

DEFAULTCHARSET

TD

> <

TD

>

Sets or retrial the default chata of the document.

TD

>

TR

>

<

TR

> <

TD

>

DesignMode

TD

> <

TD

>

Sets or retrieves WHETER THE Document Can Be Edited.

TD

>

TR

>

<

TR

> <

TD

>

DocumentElement

TD

> <

TD

>

Retrieves a reason to the root node of the document.

TD

>

TR

>

<

TR

> <

TD

>

Domain

TD

> <

TD

>

Sets or retrials the security domain of the document.

TD

>

TR

>

TABLE

>

TD

>

TR

>

TABLE

>

<

Script

Language

= "JavaScript"

>

ANOLE ('Demo', 1, '#fffff', '#ccccff', '# cc99ff');

Script

>

Body

>

HTML

>

转载请注明原文地址:https://www.9cbs.com/read-132357.html

New Post(0)