jQuery one() 方法
jQuery 教程
· 2019-03-26 20:42:45
实例
当点击 <p> 元素时,增加该元素的文本大小(每个 <p> 元素只能触发一次事件):
$("p").one("click",function(){
$(this).animate({fontSize:"+=6px"});
});
$(this).animate({fontSize:"+=6px"});
});
定义和用法
one() 方法为被选元素添加一个或多个事件处理程序,并规定当事件发生时运行的函数。
当使用 one() 方法时,每个元素只能运行一次事件处理程序函数。
语法
$(selector).one(event,data,function)
| 参数 | 描述 |
|---|---|
| event | 必需。规定添加到元素的一个或多个事件。 由空格分隔多个事件值。必须是有效的事件。 |
| data | 可选。规定传递到函数的额外数据。 |
| function | 必需。规定当事件发生时运行的函数。 |
点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html
Making Things See
Greg Borenstein / Make / 2012-2-3 / USD 39.99
Welcome to the Vision Revolution. With Microsoft's Kinect leading the way, you can now use 3D computer vision technology to build digital 3D models of people and objects that you can manipulate with g......一起来看看 《Making Things See》 这本书的介绍吧!