<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)  編輯  收藏

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


    網站導航:
     
    主站蜘蛛池模板: 破了亲妺妺的处免费视频国产| 最近中文字幕国语免费完整| 免费中文熟妇在线影片| 内射干少妇亚洲69XXX| 三上悠亚在线观看免费| 中文字幕人成人乱码亚洲电影 | 永久免费av无码不卡在线观看| 日本亚洲欧洲免费天堂午夜看片女人员 | 又粗又大又黑又长的免费视频| 久久久久亚洲AV无码专区首JN| 3344永久在线观看视频免费首页 | 国产97视频人人做人人爱免费| 亚洲人成无码网站久久99热国产| 三年片在线观看免费观看大全中国| 免费在线观看理论片| 国产精品小视频免费无限app| 日韩亚洲变态另类中文| 久久美女网站免费| 亚洲国产一区在线观看| 无码一区二区三区免费视频 | 国产免费av片在线无码免费看| 久青草国产免费观看| 国产亚洲一区二区精品| 久久免费看黄a级毛片| 国产精品高清视亚洲一区二区 | 亚洲成亚洲乱码一二三四区软件| 久久久久久国产精品免费免费男同| 久久久亚洲AV波多野结衣| 美女黄网站人色视频免费国产| 国产成人亚洲综合a∨| 亚洲国产成人片在线观看| 国拍在线精品视频免费观看| 亚洲av无码兔费综合| 国产AV无码专区亚洲A∨毛片| 亚洲免费福利视频| 欧亚一级毛片免费看| 久久精品国产亚洲AV麻豆网站| 日本免费一区二区三区最新| 国产亚洲精品免费视频播放| 亚洲人成电影在线观看网| 亚洲一区二区三区乱码A|