zoukankan      html  css  js  c++  java
  • 事件的绑定(单个、多个)

    ---------------------------------------------------------------------------

    绑定单个事件

    <script type="text/javascript">
    $(function(){
         $("input[name=event_1]").bind("click",function(){
               $("p").css("background-color","#F30");
         });
    });
    </script>

    ----------------------------------------------------------------------------

    绑定多个事件

    <script type="text/javascript">
      $(function(){
            $("input[name=event_1]").bind({
                     mouseover:function(){
                          $("ul").css("display","none");
                      },
                     mouseout:function(){
                           $("ul").css("display","block");
                      },
              });
      });
    </script>

    -----------------------------------------------------------------------------

  • 相关阅读:
    模板方法模式
    策略模式
    享元模式
    组合模式
    桥接模式
    外观模式
    代理模式
    装饰者模式
    适配器模式
    类之间的关联关系和依赖关系
  • 原文地址:https://www.cnblogs.com/atlj/p/8065403.html
Copyright © 2011-2022 走看看