张孝祥专栏

以平常心工作,远离忧虑,除了让自己快乐,也要让别人快乐!

张孝祥ID:zhangxiaoxiang
540621次访问,排名68好友4人,关注者48
zhangxiaoxiang的文章
原创 129 篇
翻译 0 篇
转载 2 篇
评论 300 篇
张孝祥的公告
《深入体验Java Web开发内幕——高级特性》已经出版。 传智播客开展:先培训,就业后再还款活。详细信息查询:http://www.itcast.cn/goodnews.htm
最近评论
ypf20062008:顶!顶!张老师加油!
yangfion171:那些人动不动就是 什么“数学第一”
没办法,当年我连名都上不了。。。
jakcysun:一看就是乱说,很不符合现实的!
zou_wei_forever:期待张老师的hibernate和spring系列类的书的出版,希望张老师继续发扬通俗易懂,对知识的深入剖析这一写作风格---永远支持你!!!!
GXZheng1985:很认真看完张老师的文章 ,看得出 您是一个非常尽心尽责的好老师 ,十分之佩服~~
但我感觉您的课程有些乏味,,基础很重要,不错,要让人接受好的东西,首先要让人感觉有意思,自然大家都会去学习~
文章分类
收藏
    相册
    传智播客原创教材展示
    培训
    《深入体验javaweb开发内幕——高级特性》出版啦!
    培训就业后还款计划正式启航
    良少的blog
    存档
    软件项目交易
    订阅我的博客
    XML聚合  FeedSky
    订阅到鲜果
    订阅到Google
    订阅到抓虾
    订阅到BlogLines
    订阅到Yahoo
    订阅到GouGou
    订阅到飞鸽
    订阅到Rojo
    订阅到newsgator
    订阅到netvibes

    原创 自己对“用不同颜色显示表格奇偶行的例子”扩充了用不同颜色显示鼠标单击的行 收藏

    新一篇: csdn的blog后台程序的导航菜单的实现 | 旧一篇: 从最简单和朴素的水平导航菜单栏到复杂的图片导航菜单栏的实现

    主要是在原来的css基础上增加了一个自定义的RowSelect属性,这个属性通过expression表达式进行设置,我现在的感觉是expression中必须是一个?表达式,在?表达式中才能写我们想要的javascript方法,等以后有时间了再专门来求证这个疑问。如果是我猜想的这样,哪有什么更好的替代方式吗?这种替代方式就是behavior吗?一切都安排在以后清闲了再研究吧!

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>双色表格CSS实例</title>
    <style type="text/css">
    .test {
       background-color:red;
    }
    #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" : "");
        RowSelect: expression(0==1?"":(
       onclick = function()
                {
                       window.currentRow?window.currentRow.style.backgroundColor=(
                        this.style.backgroundColor != "#69cdff" ? "#69cdff" :
                        (
                            this.sectionRowIndex == 0 ? "#FFCCCC" :
                            (
                                this.sectionRowIndex % 2 == 0 ? "#FFF0F0" : "#F0F0FF"
                            )
                        )
                    ):"";
                   this.style.backgroundColor="#f3c3f3";
                   window.currentRow=this;
                    window.stopOut=true;
                }
     )
     );

        TableSelect: expression(
            this.sectionRowIndex == 0 ? "" :
            (
                onmouseover = function()
                {
      window.stopOut=false;
                    this.style.backgroundColor =
                    (
                        this.style.backgroundColor != "#69cdff" ? "#69cdff" :
                        (
                            this.sectionRowIndex == 0 ? "#FFCCCC" :
                            (
                                this.sectionRowIndex % 2 == 0 ? "#FFF0F0" : "#F0F0FF"
                            )
                        )
                    )
                },
                onmouseout = function()
                {
      if(window.stopOut) return;
                    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
        )
    }
    .FindAreaTable1 {
        font-size: 12px;
        color: #333333;
        text-decoration: none;
        width: 400px;
        cursor: hand;
        background-color: #FFFFFF;
        vertical-align: middle;
        text-align: center;
    }
    </style>
    </head>
    <body>
    <table cellspacing="1" class="FindAreaTable1" ID="DataGrid1">
      <tr>
        <td>首行首列</td>
        <td>首行</td>
        <td>首行</td>
        <td>首行</td>
        <td>首行</td>
        <td>首行</td>
      </tr>
      <tr>
        <td>行1首列</td>
        <td>行1</td>
        <td>行1</td>
        <td>行1</td>
        <td>行1</td>
        <td>行1</td>
      </tr>
      <tr>
        <td>行2首列</td>
        <td>行2</td>
        <td>行2</td>
        <td>行2</td>
        <td>行2</td>
        <td>行2</td>
      </tr>
      <tr>
        <td>行3首列</td>
        <td>行3</td>
        <td>行3</td>
        <td>行3</td>
        <td>行3</td>
        <td>行3</td>
      </tr>
      <tr>
        <td>行4首列</td>
        <td>行4</td>
        <td>行4</td>
        <td>行4</td>
        <td>行4</td>
        <td>行4</td>
      </tr>
      <tr>
        <td>行5首列</td>
        <td>行5</td>
        <td>行5</td>
        <td>行5</td>
        <td>行5</td>
        <td>行5</td>
      </tr>
    </table>
    </body>
    </html>
     

    发表于 @ 2007年10月10日 22:22:00|评论(loading...)|编辑

    新一篇: csdn的blog后台程序的导航菜单的实现 | 旧一篇: 从最简单和朴素的水平导航菜单栏到复杂的图片导航菜单栏的实现

    评论

    #rover5258 发表于2008-04-08 16:01:28  IP: 125.122.54.*
    看了效果确实很不错,但通用性不怎么好,在firefox2下面完全没有效果,同样您的其他很多代码也有这反面的问题,都只是在IE下面才有效果
    发表评论  


    当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
    Csdn Blog version 3.1a
    Copyright © 张孝祥