分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
项目需求,我需要在页面加载完之后给新添加的元素增加focus事件, 我用的jQuery1.3,据说多了个live()事件,可以支持这种重复绑定问题,可是去官网一看:
Possible event values: click
, dblclick
, mousedown
, mouseup
, mousemove
, mouseover
, mouseout
, keydown
, keypress
, keyup
Currently not supported: blur
, focus
, mouseenter
, mouseleave
, change
, submit
真晕啊,我就是要处理blur,focus事件的,干嘛不支持,不支持realse干嘛啊 。。。
此例使用了livequery( matchedFn ),场景是:
好在发现一个插件,livequery
例子:
$('#table tr td').livequery(function(){$(this).find("input#quotes").focus(function(){ //focus event}),$(this).find("input#serial_num").focus(function(){ // focus event})});$('#table tr td').livequery(function(){$(this).find("input#quotes").blur(function(){ //blur event}),$(this).find("input#serial_num").blur(function(){ //blur event})});
- $('#table tr td
- ').livequery(function(){
- $(this).find("input#quotes").focus(function(){
- //focus event
- }),
- $(this).find("input#serial_num").focus(function(){
- // focus event
- })
- });
- $('#table tr td
- ').livequery(function(){
- $(this).find("input#quotes").blur(function(){
- //blur event
- }),
- $(this).find("input#serial_num").blur(function(){
- //blur event
- })
- });
给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow
![这里写图片描述](https://i-blog.csdnimg.cn/blog_migrate/2e19ffb3303a490d20ea5d00dd397156.gif)