<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    wangflood

    精心維護一個技術blog,為了工作,也是愛好。

      BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
      14 Posts :: 19 Stories :: 8 Comments :: 0 Trackbacks
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title></title>
    <script type="text/javascript" src="lib/jquery-1.5.2.js"></script>
    <style type="text/css">
    .red 
    {
        background-color
    : red;
    }

    .green 
    {
        background
    : green;
    }
    </style>

    <script type="text/javascript">
        $(
    function() {
            
    //pre元素下的所有子孫元素。
            //$("form input")選 中[ <input name="name" />, <input name="newsletter" /> ] 
            /*
             $("form input").hover(function() {
             $(this).addClass("green");
             }, function() {
             $(this).removeClass("green");
             });
             
    */
            
    //pre元素下的子元素。
            //[ <input name="name" /> ] 
            /*
            $("form>input").hover(function() {
                $(this).addClass("green");
            }, function() {
                $(this).removeClass("green");
            });
             
    */

            
    //pre元素后的next元素。pre 與next平級
            //[ <input name="name" />, <input name="newsletter" /> ] 
            /*$("label+input").hover(function() {
                    $(this).addClass("green");
                }, function() {
                    $(this).removeClass("green");
                });
             
    */

            
    //[ <input name="none" /> ] 
            //prev元素之后所有sibings元素
            //siblings和next不同,siblings返回的是,所有同輩元素的集合。next,僅是一個。
            /*
            $("form ~ input").hover(function() {
                $(this).addClass("green");
            }, function() {
                $(this).removeClass("green");
            });
             
    */

            
    //這就是next方式,選 中的只有一個。
            $("form +input").hover(function() {
                $(
    this).addClass("green");
            }, 
    function() {
                $(
    this).removeClass("green");
            });

        });
    </script>
    </head>
    <body>
        
    <form>
            
    <label>Name:</label> <input name="name" />
            
    <fieldset>
                
    <label>Newsletter:</label> <input name="newsletter" />
            
    </fieldset>
        
    </form>
        
    <input name="none" />
        
    <input name="second" />
    </body>
    </html>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title></title>
    <script type="text/javascript" src="lib/jquery-1.5.2.js"></script>
    <style type="text/css">
    .red 
    {
        background-color
    : red;
    }

    .green 
    {
        background
    : green;
    }
    </style>

    <script type="text/javascript">
        $(
    function() {

            
    //匹配找到的第一個元素
            //[ <tr><td>Header 1</td></tr> ] 
            /*
            $("tr:first").hover(function() {
                $(this).addClass("green");
            }, function() {
                $(this).removeClass("green");
            });
             
    */
            
    //匹配找到的最后一個元素
            //[ <tr><td>Value 2</td></tr> ] 
            /*
            $("tr:last").hover(function() {
                $(this).addClass("green");
            }, function() {
                $(this).removeClass("green");
            });
             
    */
            
    //能夠 checked的input才有:checked
            /*
            $("input:not(:checked)").hover(function() {
                $(this).addClass("green");
            }, function() {
                $(this).removeClass("green");
            });
             
    */
            
    //偶數元素,從0開始計數
            /*
            $("tr:even").hover(function() {
                $(this).addClass("green");
            }, function() {
                $(this).removeClass("green");
            });
    */
            
    //奇數元素,從0開始計數。
            /*
            $("tr:odd").hover(function() {
                $(this).addClass("green");
            }, function() {
                $(this).removeClass("green");
            });
             
    */
            
    //匹配給定的索引的元素。
            /*
            $("tr:eq(1)").hover(function() {
                $(this).addClass("green");
            }, function() {
                $(this).removeClass("green");
            });
    */

            
    //大于給定索引的元素。
            /*
            $("tr:gt(1)").hover(function() {
                $(this).addClass("green");
            }, function() {
                $(this).removeClass("green");
            });
             
    */

            
    //小于給定索引元素的。此時只匹配index=0
            /*
            $("tr:lt(1)").hover(function() {
                $(this).addClass("green");
            }, function() {
                $(this).removeClass("green");
            });
             
    */
            
    //匹配H1,H2,H3之類的標題元素。
            // $(":header").css("background"."#EEE");
            //:animated 所有正在執行動畫的元素
            $("#run").click(function() {
                $(
    "div:not(:animated)").animate({
                    height : 'toggle',
                    opacity : 'toggle'
                }, 
    "slow");
            });

        });
    </script>
    </head>
    <body>
        
    <table>
            
    <tr>
                
    <td>Header 1</td>
            
    </tr>
            
    <tr>
                
    <td>Value 1</td>
            
    </tr>
            
    <tr>
                
    <td>Value 2</td>
            
    </tr>
        
    </table>


        
    <input type="checkbox" name="apple" />
        
    <input type="checkbox" name="flower" checked="checked" />

        
    <h1>Header 1</h1>
        
    <p>Contents 1</p>
        
    <h2>Header 2</h2>
        
    <p>Contents 2</p>

        
    <button id="run">Run</button>
        
    <div>love you</div>
    </body>
    </html>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>jquery Content</title>
    <script type="text/javascript" src="lib/jquery-1.5.2.js"></script>
    <style type="text/css">
    .red 
    {
        background-color
    : red;
    }

    .green 
    {
        background
    : green;
    }
    </style>

    <script type="text/javascript">
        $(
    function() {

            
    //所有包含給定的文本的元素
            /*
            $("div:contains('John')").hover(function() {
                $(this).addClass("red");
            }, function() {
                $(this).removeClass("red");
            });
             
    */
            
    //不包含子元素或文本的元素。
            /*
            $("td:empty").hover(function() {
                $(this).text("afaf");
            }, function() {
                $(this).addClass("red");
            });
             
    */
            
    //has(selector)
            //匹配含有選擇器的元素的元素。
            /*
            $("div:has(p)").hover(function() {
                $(this).addClass("red");
            }, function() {
                $(this).removeClass("red");
            });
             
    */
            
    //跟empty正好相反,含有子元素或文本的。
            $("td:parent").hover(function() {
                $(
    this).addClass("red");
            }, 
    function() {
                $(
    this).removeClass("red");
            });
        });
    </script>
    </head>
    <body>
        
    <div id="one">
            
    <p></p>
            John Resig
        
    </div>
        
    <div>George Martin</div>
        
    <div>Malcom John Sinclair</div>
        
    <div>
            J. Ohn

            
    <table>
                
    <tr>
                    
    <td>Value 1</td>
                    
    <td></td>
                
    </tr>
                
    <tr>
                    
    <td>Value 2</td>
                    
    <td></td>
                
    </tr>
            
    </table>
    </body>
    </html>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>可見性</title>
    <script type="text/javascript" src="lib/jquery-1.5.2.js"></script>
    <style type="text/css">
    .red 
    {
        background-color
    : red;
    }

    .green 
    {
        background
    : green;
    }
    </style>

    <script type="text/javascript">
        $(
    function() {
            $(
    "tr:visible").hover(function() {
                $(
    this).css("display""none");
                $(
    "tr:hidden").show();
            });

        });
    </script>
    </head>
    <body>
        
    <table>
            
    <tr style="display: none">
                
    <td>Value 1</td>
            
    </tr>
            
    <tr>
                
    <td>Value 2</td>
            
    </tr>
        
    </table>
    </body>
    </html>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>可見性</title>
    <script type="text/javascript" src="lib/jquery-1.5.2.js"></script>
    <style type="text/css">
    .red 
    {
        background-color
    : red;
    }

    .green 
    {
        background
    : green;
    }
    </style>

    <script type="text/javascript">
        $(
    function() {
            
    //包含給定屬性的元素。
            /*
            $("div[id]").hover(function() {
                $(this).addClass("green");
            }, function() {
                $(this).removeClass("green");
            });
             
    */
            
    //指定屬性=value的元素。
            //$("input[name='newsletter']").attr("checked", true);
            //指定屬性!=value的元素。
            //$("input[name!='newsletter']").attr("checked", true);
            //指定元素屬性以xx開始的
            //$("input[name^='accept']").attr("checked", true);
            //指定元素屬性以xx結束的
            //$("input[name$='r']").attr("checked", true);
            //指定元素屬性以包含xx
            //$("input[name*='let']").attr("checked", true);
            //復合選擇器
            $("input[id][name='newsletter']").attr("checked"true);
        });
    </script>
    </head>
    <body>
        
    <div>
            
    <p>Hello!</p>
        
    </div>
        
    <div id="test2">has a id property</div>

        
    <input id="test3" type="checkbox" name="newsletter" value="Hot Fuzz" />
        
    <input type="checkbox" name="newsletter" value="Cold Fusion" />
        
    <input type="checkbox" name="accept" value="Evil Plans" />
        
    <input type="checkbox" name="acceptor" value="Sam Wang" />

    </body>
    </html>
    posted on 2011-04-12 12:23 wangflood 閱讀(311) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 人人揉揉香蕉大免费不卡| 精品在线视频免费| 久久99精品视免费看| 国产亚洲情侣一区二区无| 三级片免费观看久久| 亚洲国产成人乱码精品女人久久久不卡 | 久操免费在线观看| 亚洲国产精品VA在线看黑人| 免费播放在线日本感人片| 亚洲AV无码专区电影在线观看| 精品免费视在线观看| 日韩亚洲AV无码一区二区不卡| 久久久久久国产精品免费免费男同 | 美女被免费网站视频在线| 四虎影视精品永久免费网站| 国产亚洲午夜精品| 亚洲中文字幕无码久久综合网| 免费一级毛片无毒不卡| 亚洲毛片基地日韩毛片基地| 无人在线观看完整免费版视频| 亚洲色少妇熟女11p| 免费大学生国产在线观看p| 亚洲一区二区三区免费| 久久精品国产96精品亚洲| 国产高清免费视频| 精品国产日韩亚洲一区在线| 4338×亚洲全国最大色成网站| 嫩草成人永久免费观看| 亚洲国产综合精品中文第一| 免费a级毛片在线观看| 花蝴蝶免费视频在线观看高清版 | 久久久久久亚洲精品影院| 免费人成视频在线观看视频 | 亚洲一区二区久久| 亚洲av高清在线观看一区二区 | 精品亚洲国产成人| 亚洲国产精品国产自在在线| 一级毛片免费毛片一级毛片免费| 亚洲人成人无码.www石榴| 中文字幕亚洲综合久久菠萝蜜| 67pao强力打造高清免费|