博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【JQuery】事件
阅读量:4583 次
发布时间:2019-06-09

本文共 2451 字,大约阅读时间需要 8 分钟。

一、前言

       接着上一章选择器的知识,继续啊jQuery的学习

 

二、内容

$(function(){}) 文档初始化加载event.pageX  相对于文档左边缘的鼠标位置event.pageY  相对于文档上边缘的鼠标位置event.preventDefault()  阻止元素发生默认行为  event.isDefaultPrevented()  指明是否调用了preventDefault() event.result 被指定事件处理器返回的最后一个值event.target 哪个DOM元素触发了该元素event.timeStamp 该事件发生时的时间event.type   事件的类型event.which  按了哪个键或按钮bind 绑定事件(对当前存在元素)         $(selector).bind("event",data,function)blur 元素失去焦点     $(selector).blur(function)change 元素(select,text,textarea)值发生变化     $(selector).change(function)click 点击元素     $(selector).click(function)dbclick 双击元素     $(selector).dbclick(function)delegate 为子元素添加事件,data可选     $(selector).delegate(childSelector,"event",data,function)undelegate 删除由delegate()添加的事件     $(selector).undelegate(selector,"event",)die 移除通过live()方法向元素添加的事件     $(selector).die("event",function)error 元素遇到错误     $(selector).error(function)focus 元素获得焦点     $(selector).focus(function)keydown 按钮按下过程     $(selector).keydown(function)keypress 按钮按下抬起     $(selector).keypress(function)keyup 按钮抬起     $(selector).keyup(function)live 附加事件,注意与bind的区别     $(selector).live("event",data,function)load 加载事件     $(selector).load(function)unload 离开页面,只应用于window对象     $(window).unload(function)mouseup 鼠标抬起事件     $(selector).mouseup(function)mousedown 鼠标按下事件     $(selector).mousedown(function)mouseenter 鼠标进入元素事件     $(selector).ouseenter(function)mouseleave 鼠标离开被选元素事件     $(selector).mouseleave(function)mousemove 鼠标移动事件,慎用,影响性能     $(selector).mousemove(function)mouseout 鼠标离开被选元素或其子元素     $(selector).mouseout(function)one 为元素绑定只能运行一次的事件     $(selector).one("event",data,function)resize 窗口调整大小     $(selector).resize(function)scroll 可滚动对象滑动元素     $(selector).scroll(function)select 当textarea或文本型的input元素的文本被选择时     $(selector).select(function)submit 提交表单     $(selector).submit(function)toggle 轮流切换多个事件,       第一次点击执行第一个function       第二次点击执行第二个function       ...     $(selector).toggle(function1,function2,function3)              切换Hide()和Show()状态     $(selector).toggle(speed,callback)       规定是否只显示或只隐藏匹配元素,true显示;false隐藏     $(selector).toggle(switch)trigger 触发事件     $(selector).trigger("event", [param1,param2,...])     $(selector).trigger(eventObj)triggerHandler 触发事件,               不冒泡,               不触发浏览器事件,               只影响第一个匹配项     $(selector).triggerHandler(function1,function2,function3)unbind 移除绑定事件     $(selector).unbind("event",function)     $(selector).unbind(eventObj)

 

转载于:https://www.cnblogs.com/lovecsharp094/p/8448706.html

你可能感兴趣的文章
在CentOS下面编译WizNote Qt Project
查看>>
android list view 实现动态加载
查看>>
NFS工作原理
查看>>
nginx配置用户认证
查看>>
Kubernetes的Cron Job
查看>>
41岁中兴员工:这可能是我第5次失业_中兴被美国制裁的思考
查看>>
go工程组织规范
查看>>
排序---冒泡排序
查看>>
(原)欧式距离变换
查看>>
ASP.Net各个命名空间及作用
查看>>
latex用fonspec包需要xelatex编译
查看>>
java必备技能
查看>>
oracle里的统计信息
查看>>
PostgreSQL 监控磁盘使用
查看>>
HDU 4586 Play the Dice(数学期望)
查看>>
codeforce1029B B. Creating the Contest(简单dp,简单版单调栈)
查看>>
VC ++ 数据库资料收集理解
查看>>
ie11浏览器版本不识别
查看>>
千万要避免的五种程序注释方式
查看>>
redmine 1.2.1安装和安装会出现的问题
查看>>