js ondocumentready onmouseover onclick onmouseout style_javascript スキル

WBOY
リリース: 2016-05-16 18:22:33
オリジナル
1266 人が閲覧しました
复制代代码如下:






<スクリプト言語="JavaScript">
var lastObj = null;
var lastColor = null;
function doInit(){
if(element==null){
return;
}
var objT = 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;iif(i%2==1){
objT.rows(i).className="gridding1";
}
else{
objT.rows(i).className="gridding1";
}
}
}
関数 doClick(){
if(event.srcElement.tagName=="TD"){
var curObj =event.srcElement.parentElement;
if(curObj.rowIndex==0) は false を返します。
try{
if(curObj.children[0].children.length == 0 ) return false;
}
catch(err){
return false;
}
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{
var curObj =event.srcElement.parentElement.parentElement;
if(curObj.rowIndex==0) {
var obj = curObj.parentElement.parentElement;
for(i=1;iif(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){
return true;
}
}
}
function doMouseover(){
if(event.srcElement.tagName=="TD"){
var curObj =event.srcElement.parentElement;
if(curObj.rowIndex==0) は false を返します。
curObj.style.backgroundColor="#F2FFEE";
}
if(event.srcElement.tagName=="INPUT"){
var curObj =event.srcElement.parentElement.parentElement;
if(curObj.rowIndex==0) は false を返します。
curObj.style.backgroundColor="#F2FFEE";
}
}
関数 doMouseout(){
if(event.srcElement.tagName=="TD"){
var curObj =event.srcElement.parentElement;
if(curObj.rowIndex==0) は false を返します。
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";
}
true を返します。
}
}
catch(err){
if(curObj.rowIndex%2==1){
curObj.style.backgroundColor="#FFFFFF";
curObj.style.color="#000000";
}
else{
curObj.style.backgroundColor="#FFFFFF";
curObj.style.color="#000000";
}
true を返します。
}
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"){
var curObj =event.srcElement.parentElement.parentElement;
if(curObj.rowIndex==0) は false を返します。
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){
true を返します。
}
}
}

関連ラベル:
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!