css里可以加表达式 :expression
2006-12-16 13:05
295 查看
比较强的css
HTML代码:<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>表格CSS测试</title>
<style type="text/css">
<!--
#DataGrid1 tr {
background-color: expression(
this.sectionRowIndex == 0 ? "#FFCCCC" :
(
(this.sectionRowIndex % 2 == 0) ? "#FFF0F0" : "#F0F0FF"
)
);
color: expression(this.sectionRowIndex == 0 ? "#FFFFFF" : "");
font-weight: expression(this.sectionRowIndex == 0 ? "BOLD" : "");
TableSelect: expression(
this.sectionRowIndex == 0 ? "" :
(
onmouseover = function()
{
this.style.backgroundColor =
(
this.style.backgroundColor != "#69cdff" ? "#69cdff" :
(
this.sectionRowIndex == 0 ? "#FFCCCC" :
(
this.sectionRowIndex % 2 == 0 ? "#FFF0F0" : "#F0F0FF"
)
)
)
},
onmouseout = function()
{
this.style.backgroundColor =
(
this.style.backgroundColor != "#69cdff" ? "#69cdff" :
(
this.sectionRowIndex == 0 ? "#FFCCCC" :
(
this.sectionRowIndex % 2 == 0 ? "#FFF0F0" : "#F0F0FF"
)
)
)
}
)
)
}
#DataGrid1 td {
background-color:expression(
this.cellIndex == 0 ?
(
this.parentElement.sectionRowIndex == 0 ? "#FFCCCC" : "#DDDDDD"
)
: null
)
}
.FindAreaTable {
font-size: 12px;
color: #333333;
text-decoration: none;
width: 1024px;
cursor: hand;
background-color: #FFFFFF;
vertical-align: middle;
text-align: center;
}
-->
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<table cellspacing="1" class="FindAreaTable" ID="DataGrid1">
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
</table>
</body>
</html>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
css里可以加表达式 :expression
<style>
<!--
.td { font-size: 9pt; weaver:expression(highlight(this))}
-->
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
function highlight(obj){
var hightlightBgColor = '#d6d6d6';
obj.onmouseover = function(){
var o = event.srcElement;
if(o.tagName=="TD"){
with(o.parentElement){
style.backgroundColor = hightlightBgColor;
}
}
}
obj.onmouseout = function(){
var o = event.srcElement;
if(o.tagName=="TD"){o.parentElement.style.backgroundColor = '';}
}
}
function ControlContent01(){
if (contentid01.style.display == 'none'){
contentid01.style.display = '';
imgarrow01.src = 'gray_up_arrow.gif';
}
else {
contentid01.style.display = 'none';
imgarrow01.src = 'gray_down_arrow.gif';
}
}
//-->
</SCRIPT>
==================================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> CSS样式里使用JavaScript(onmouseover/onmouseout)2</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style type="text/css">
table
{
background-color:#000000;
cursor:hand;
}
td
{
/*设置onmouseover事件*/
onmouseover: expression(onmouseover=function (){this.style.borderColor ='blue';this.style.color='red';this.style.backgroundColor ='yellow'});
/*设置onmouseout事件*/
onmouseout: expression(onmouseout=function (){this.style.borderColor='';this.style.color='';this.style.backgroundColor =''});
background-color:#ffffff;
}
</style>
</HEAD>
<BODY>
<TABLE cellspacing='1px' border='1'>
<TR >
<TD >风儿吹散了蒲公英...... </TD>
<TD>风儿吹散了蒲公英...... </TD>
<TD>风儿吹散了蒲公英...... </TD>
</TR>
<TR >
<TD >风儿吹散了蒲公英...... </TD>
<TD>风儿吹散了蒲公英...... </TD>
<TD>风儿吹散了蒲公英...... </TD>
</TR>
</TABLE>
</BODY>
</HTML>
HTML代码:<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>表格CSS测试</title>
<style type="text/css">
<!--
#DataGrid1 tr {
background-color: expression(
this.sectionRowIndex == 0 ? "#FFCCCC" :
(
(this.sectionRowIndex % 2 == 0) ? "#FFF0F0" : "#F0F0FF"
)
);
color: expression(this.sectionRowIndex == 0 ? "#FFFFFF" : "");
font-weight: expression(this.sectionRowIndex == 0 ? "BOLD" : "");
TableSelect: expression(
this.sectionRowIndex == 0 ? "" :
(
onmouseover = function()
{
this.style.backgroundColor =
(
this.style.backgroundColor != "#69cdff" ? "#69cdff" :
(
this.sectionRowIndex == 0 ? "#FFCCCC" :
(
this.sectionRowIndex % 2 == 0 ? "#FFF0F0" : "#F0F0FF"
)
)
)
},
onmouseout = function()
{
this.style.backgroundColor =
(
this.style.backgroundColor != "#69cdff" ? "#69cdff" :
(
this.sectionRowIndex == 0 ? "#FFCCCC" :
(
this.sectionRowIndex % 2 == 0 ? "#FFF0F0" : "#F0F0FF"
)
)
)
}
)
)
}
#DataGrid1 td {
background-color:expression(
this.cellIndex == 0 ?
(
this.parentElement.sectionRowIndex == 0 ? "#FFCCCC" : "#DDDDDD"
)
: null
)
}
.FindAreaTable {
font-size: 12px;
color: #333333;
text-decoration: none;
width: 1024px;
cursor: hand;
background-color: #FFFFFF;
vertical-align: middle;
text-align: center;
}
-->
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<table cellspacing="1" class="FindAreaTable" ID="DataGrid1">
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
<tr>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
<td>表格测试</td>
</tr>
</table>
</body>
</html>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
css里可以加表达式 :expression
<style>
<!--
.td { font-size: 9pt; weaver:expression(highlight(this))}
-->
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
function highlight(obj){
var hightlightBgColor = '#d6d6d6';
obj.onmouseover = function(){
var o = event.srcElement;
if(o.tagName=="TD"){
with(o.parentElement){
style.backgroundColor = hightlightBgColor;
}
}
}
obj.onmouseout = function(){
var o = event.srcElement;
if(o.tagName=="TD"){o.parentElement.style.backgroundColor = '';}
}
}
function ControlContent01(){
if (contentid01.style.display == 'none'){
contentid01.style.display = '';
imgarrow01.src = 'gray_up_arrow.gif';
}
else {
contentid01.style.display = 'none';
imgarrow01.src = 'gray_down_arrow.gif';
}
}
//-->
</SCRIPT>
==================================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> CSS样式里使用JavaScript(onmouseover/onmouseout)2</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style type="text/css">
table
{
background-color:#000000;
cursor:hand;
}
td
{
/*设置onmouseover事件*/
onmouseover: expression(onmouseover=function (){this.style.borderColor ='blue';this.style.color='red';this.style.backgroundColor ='yellow'});
/*设置onmouseout事件*/
onmouseout: expression(onmouseout=function (){this.style.borderColor='';this.style.color='';this.style.backgroundColor =''});
background-color:#ffffff;
}
</style>
</HEAD>
<BODY>
<TABLE cellspacing='1px' border='1'>
<TR >
<TD >风儿吹散了蒲公英...... </TD>
<TD>风儿吹散了蒲公英...... </TD>
<TD>风儿吹散了蒲公英...... </TD>
</TR>
<TR >
<TD >风儿吹散了蒲公英...... </TD>
<TD>风儿吹散了蒲公英...... </TD>
<TD>风儿吹散了蒲公英...... </TD>
</TR>
</TABLE>
</BODY>
</HTML>
相关文章推荐
- 你应该了解的强大CSS表达式 ----- expression
- 强大的CSS表达式 - expression
- 强大的CSS表达式 ----- expression
- 去掉CSS中的表达式Expression
- CSS执行JS表达式或函数 CSS中expression使用简介
- CSS中使用expression表达式
- CSS中使用expression,用来把CSS属性和Javas cript表达式关联起来
- IE css expression(表达式)
- CSS的expression判断表达式设置input样式
- CSS系列:表达式(Expression)`淘汰`
- CSS表达式(expression)解决IE6 position:fixed无效问题
- IE8标准模式不再支持CSS表达式(Expression)
- 以下css可以清除浮动
- java基础:java switch(表达式)中表达式的类型都可以是哪些类型?
- 利用css里expression来实现界面对象的批量控制
- [VB.NET]正则表达式可以先在VB.net 的FORM中吗?怎么写?
- quartz CronExpression表达式..。
- CSS中expression的使用方法...
- 利用css里expression来实现界面对象的批量控制
- 正则表达式匹配也可以简单快速(下:实现部分)