2018-08-28

2018-08-28  本文已影响0人  OK_1f21

stop() 不会记录移入移出的次数

mouseenter /  mouseleave  移入移出取消事件冒泡

blur() 取决焦点,蓝框消失

focus  获取焦点

autofocus = true  直接焦点

change  失去焦点触发  (要有内容)

keyup 松开按键触发

load  加载完毕

bind 绑定事件    unbind取消绑定

trigger 触发事件


事件冒泡:

event  系统封装的事件

clientY/clientX 点击坐标

event.stopPropagation(阻止事件冒泡,默认菜单)

contextmenu 阻止默认行为

return false   合并阻止

resize  窗口改变尺寸的时候,会高频触发

window.onload = function(){}

$(window).load(function(){});

$(document).ready(function(){})

$(function(){})

$(window).resize(function(){

console.log('3');

});


delegate 事件委托

delegate(‘事件’,‘执行条件’,执行事件)

selector选择器:写入ul下面的所有要发生事件的元素,多个元素用空格隔开,例如‘li a span’

eventType事件

function要执行的操作

undelegate    取消委托

append 插入标签  appendTo 相反

prepend 前面插入  prependTo 相反

before 插入前面  insertBefore

ofter  /  insertAfter

名称.remove()   删除标签

面试:有append 和 appendto 都是从后面插入一个元素   before 和 ofter 给当前元素添加一个兄弟元素 

mousewheel  滚动  

$(window).height()  窗口宽度

上一篇 下一篇

猜你喜欢

热点阅读