<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 閱讀(302) 評論(0)  編輯  收藏

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


    網站導航:
     
    主站蜘蛛池模板: 亚洲欧洲国产成人精品| 亚洲精品无码午夜福利中文字幕 | 久久国产乱子伦精品免费强| 国产又黄又爽又刺激的免费网址| 亚洲精品久久无码av片俺去也| 免费看韩国黄a片在线观看| 亚洲丰满熟女一区二区v| 成全视频免费高清| 直接进入免费看黄的网站| 全黄a免费一级毛片人人爱| 人妻仑乱A级毛片免费看| 亚洲视频一区二区| 在线观看片免费人成视频无码| 亚洲精品乱码久久久久久久久久久久 | 一区二区三区无码视频免费福利 | 免费看美女被靠到爽| 久久久久久久久无码精品亚洲日韩| 午夜一级免费视频| 成人免费观看男女羞羞视频| 亚洲一区爱区精品无码| 久久精品乱子伦免费| 亚洲免费电影网站| 国产又粗又长又硬免费视频| 一区二区三区在线免费| 久久久久亚洲AV无码专区首| 日本zzzzwww大片免费| 亚洲爆乳成av人在线视菜奈实| 亚洲人成网站观看在线播放| 香港a毛片免费观看| 亚洲美国产亚洲AV| 色噜噜AV亚洲色一区二区| xxxxx免费视频| 免费的黄网站男人的天堂| 久久91亚洲精品中文字幕| 岛国av无码免费无禁网站| 国产福利电影一区二区三区,免费久久久久久久精 | 国产美女被遭强高潮免费网站| 国产精品高清免费网站 | 久久国产成人精品国产成人亚洲| 99re在线精品视频免费| 亚洲AV综合色区无码一二三区|