zoukankan      html  css  js  c++  java
  • 基础事件(上)

    1 <form>
    2     <input type="submit" value="按钮" />
    3 </form>

    事件:

      1 $(function () {
      2 
      3     /*
      4     $('input').bind('click', function () {
      5         alert('弹窗!');
      6     });
      7 
      8     
      9     $('input').bind('click', fn);
     10     
     11     function fn() {
     12         alert('处理函数!')
     13     }
     14 
     15     
     16     $('input').bind('click mouseover', function () {
     17         alert('弹窗!');
     18     });
     19 
     20     
     21     $('input').bind('mouseover mouseout', function () {
     22         $('div').html(function (index, value) {
     23             return value + '1';
     24         });
     25     });
     26 
     27     
     28     $('input').bind({
     29         mouseover : function () {
     30             alert('移入');
     31         },
     32         mouseout : function () {
     33             alert('移出');
     34         }
     35     });
     36 
     37     
     38     $('input').bind({
     39         'mouseover' : function () {
     40             alert('移入');
     41         },
     42         'mouseout' : function () {
     43             alert('移出');
     44         }
     45     });
     46 
     47     
     48     $('input').bind('click mouseover', function () {
     49         alert('弹窗!');
     50     });
     51 
     52     
     53     $('input').bind('click', fn1);
     54     $('input').bind('click', fn2);
     55     
     56     function fn1() {
     57         alert('fn1');
     58     }
     59     
     60     function fn2() {
     61         alert('fn2');
     62     }
     63     
     64     //$('input').unbind();        //删除全部事件
     65     //$('input').unbind('click');    //只删除click事件
     66     $('input').unbind('click', fn2);  //删除click事件绑定了fn2的
     67 
     68     
     69     $('input').click(function () {
     70         alert('单击');
     71     });
     72     
     73     $('input').dblclick(function () {
     74         alert('双击');
     75     });
     76     
     77     $('input').mousedown(function () {
     78         alert('鼠标左键按下');
     79     });
     80     
     81     $('input').mouseup(function () {
     82         alert('鼠标左键按下弹起');
     83     });
     84     
     85     $(window).unload(function () {            //一般unload卸载页面新版浏览器应该是不支持的,获取要设置一个。
     86         alert('1');                                        //一般用于清理工作。
     87     });
     88     
     89     $(window).resize(function () {            
     90         alert('文档改变了');                                    
     91     });
     92     
     93     $(window).scroll(function () {            
     94         alert('滚动条改变了');                                    
     95     });
     96     $('input').select(function () {
     97         alert('文本选定');
     98     });
     99     
    100     $('input').change(function () {
    101         alert('文本改变');
    102     });
    103     */
    104 
    105     $('form').submit(function () {
    106         alert('表单提交!');
    107     });
    108     
    109     
    110     
    111 });
  • 相关阅读:
    Unix Programming :文件IO
    Git 小记
    Effective C++ Placement new
    Effective C++ 避免数组多态
    系列文章:云原生Kubernetes日志落地方案
    阿里巴巴大数据产品最新特性介绍--机器学习PAI
    Apache Flink 1.9.0版本新功能介绍
    Flink Checkpoint 问题排查实用指南
    进击的 Java ,云原生时代的蜕变
    8 分钟入门 K8s | 详解容器基本概念
  • 原文地址:https://www.cnblogs.com/jiangjianzhu/p/5519904.html
Copyright © 2011-2022 走看看