zoukankan      html  css  js  c++  java
  • 【转载】jquery的end()方法

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        
    <title>chainning code</title>
        
    <script src="../scripts/jquery-1.2.3.intellisense.js" type="text/javascript"></script>
        
    <script type="text/javascript">
            $(
    function(){
                
    //添加四个按钮
                $('<input type="button" value="click me"/><input type="button" value="triggle click me"/><input type="button" value="detach handler"/><input type="button" value="show/hide text"/>').appendTo($('body'));
                
    //找出所有按钮
                $('input[type="button"]')
                    .eq(
    0)//找到第一个按钮
                        .click(function(){
                            alert(
    'you clicked me!');
                        })
                    .end().eq(
    1)//返回所有按钮,再找到第二个
                        .click(function(){
                            $(
    'input[type="button"]:eq(0)').trigger('click');
                        })
                    .end().eq(
    2)//返回所有按钮,再找到第三个
                        .click(function(){
                            $(
    'input[type="button"]:eq(0)').unbind('click');
                        })
                    .end().eq(
    3)//返回所有按钮,再找到第四个
                        .toggle(function(){
                            $(
    '.panel').hide('slow');
                        },
    function(){
                            $(
    '.panel').show('slow');
                        });
            });
        
    </script>
        
    <style type="text/css">
            .panel
            
    {
                padding
    : 20px;
                background-color
    : #000066;
                color
    : #FFFFFF;
                font-weight
    : bold;
                width
    : 200px;
                height
    : 50px;
            
    }
        
    </style>
    </head>
    <body>
        
    <div class="panel">welcome to jQuery!</div>
    </body>
    </html>

  • 相关阅读:
    test
    【转载】ASP.NET MVC 3 —— Model远程验证
    【转载】富有客户端技术之——jQuery EasyUI
    【转载】基于ASP.NET Web Application的插件实现,附DEMO
    【转载】浅谈C#中的延迟加载(1)——善用委托
    【转载】Winform开发框架之权限管理系统
    【转载】基于我的Winform开发框架扩展而成的WCF开发框架
    [转载]10大优秀的移动Web应用程序开发框架推荐
    [转载]C#泛型列表List<T>基本用法总结
    [转载]推荐一个被大家忽视的微软的反跨站脚本库AntiXSS V3.1
  • 原文地址:https://www.cnblogs.com/fx2008/p/2249237.html
Copyright © 2011-2022 走看看