zl程序教程

您现在的位置是:首页 >  其它

当前栏目

jsondocumentreadyonmouseoveronclickonmouseout样式

样式
2023-06-13 09:14:23 时间
复制代码代码如下:

<PUBLIC:ATTACHEVENT="ondocumentready"ONEVENT="doInit()"/>
<PUBLIC:ATTACHEVENT="onmouseover"ONEVENT="doMouseover()"/>
<PUBLIC:ATTACHEVENT="onclick"ONEVENT="doClick()"/>
<PUBLIC:ATTACHEVENT="onmouseout"ONEVENT="doMouseout()"/>
<PUBLIC:PROPERTYname="test"/>
<SCRIPTLANGUAGE="JavaScript">
varlastObj=null;
varlastColor=null;
functiondoInit(){
if(element==null){
return;
}
varobjT=element.children[0];
try{
objT.rows(0).className="grid_title";
objT.rows(1).className="grid_title";
}
catch(err){
objT.className="grid_title";
}
objT=element.children[1];
if(objT.rows(0)==null){
return;
}
objT.rows(0).className="gridding1";
for(i=1;i<objT.rows.length;i++){
if(i%2==1){
objT.rows(i).className="gridding1";
}
else{
objT.rows(i).className="gridding1";
}
}
}
functiondoClick(){
if(event.srcElement.tagName=="TD"){
varcurObj=event.srcElement.parentElement;
if(curObj.rowIndex==0)returnfalse;
try{
if(curObj.children[0].children.length==0)returnfalse;
}
catch(err){
returnfalse;
}
if(curObj.children[0].children[0].checked){
curObj.children[0].children[0].checked=false;
}
else{
lastObj=curObj;
lastColor="#FFFFFF";
curObj.children[0].children[0].checked=true;
}
}
if(event.srcElement.tagName=="INPUT"){
try{
varcurObj=event.srcElement.parentElement.parentElement;
if(curObj.rowIndex==0){
varobj=curObj.parentElement.parentElement;
for(i=1;i<obj.rows.length;i++){
if(obj.rows(0).children[0].children[0].checked){
obj.rows(i).children[0].children[0].checked=true;
obj.rows(i).style.backgroundColor="#FFFFFF";
obj.rows(i).style.color="#000000";
}
else{
obj.rows(i).children[0].children[0].checked=false;
if(i%2==1){
obj.rows(i).style.backgroundColor="#FFFFFF";
obj.rows(i).style.color="#000000";
}
else{
obj.rows(i).style.backgroundColor="#FFFFFF";
obj.rows(i).style.color="#000000";
}
}
}
}
}
catch(err){
returntrue;
}
}
}
functiondoMouseover(){
if(event.srcElement.tagName=="TD"){
varcurObj=event.srcElement.parentElement;
if(curObj.rowIndex==0)returnfalse;
curObj.style.backgroundColor="#F2FFEE";
}
if(event.srcElement.tagName=="INPUT"){
varcurObj=event.srcElement.parentElement.parentElement;
if(curObj.rowIndex==0)returnfalse;
curObj.style.backgroundColor="#F2FFEE";
}
}
functiondoMouseout(){
if(event.srcElement.tagName=="TD"){
varcurObj=event.srcElement.parentElement;
if(curObj.rowIndex==0)returnfalse;
try{
if(curObj.children[0].children.length==0){
if(curObj.rowIndex%2==1){
curObj.style.backgroundColor="#FFFFFF";
curObj.style.color="#000000";
}
else{
curObj.style.backgroundColor="#FFFFFF";
curObj.style.color="#000000";
}
returntrue;
}
}
catch(err){
if(curObj.rowIndex%2==1){
curObj.style.backgroundColor="#FFFFFF";
curObj.style.color="#000000";
}
else{
curObj.style.backgroundColor="#FFFFFF";
curObj.style.color="#000000";
}
returntrue;
}
if(curObj.rowIndex%2==1)
if(curObj.children[0].children[0].checked){
curObj.style.backgroundColor="#FFFFFF";
curObj.style.color="#000000";
}
else{
curObj.style.backgroundColor="#FFFFFF";
curObj.style.color="#000000";
}
else
if(curObj.children[0].children[0].checked){
curObj.style.backgroundColor="#FFFFFF";
curObj.style.color="#000000";
}
else{
curObj.style.backgroundColor="#FFFFFF";
curObj.style.color="#000000";
}
}
if(event.srcElement.tagName=="INPUT"){
varcurObj=event.srcElement.parentElement.parentElement;
if(curObj.rowIndex==0)returnfalse;
try{
if(curObj.rowIndex%2==1){
if(curObj.children[0].children[0].checked){
curObj.style.backgroundColor="#FFFFFF";
curObj.style.color="#000000";
}
else{
curObj.style.backgroundColor="#FFFFFF";
curObj.style.color="#000000";
}
}
else{
if(curObj.children[0].children[0].checked){
curObj.style.backgroundColor="#FFFFFF";
curObj.style.color="#000000";
}
else{
curObj.style.backgroundColor="#FFFFFF";
curObj.style.color="#000000";
}
}
}
catch(err){
returntrue;
}
}
}
</SCRIPT>