我想举办一个活动,直到我准备开火,例如
$('.button').live('click', function(e){
e.preventDefault();
// do lots of stuff
e.run() //this proceeds with the normal event
}
Run Code Online (Sandbox Code Playgroud)
是否有与上述run()功能相同的功能?
我想知道是否有人可以帮助我理解如何创建不同的自定义事件监听器.
我没有特定的事件案例,但我想一般地了解它是如何完成的,所以我可以在需要的地方应用它.
我想做什么,只是让一些人可能需要知道,是:
var position = 0;
for(var i = 0; i < 10; i++)
{
position++;
if((position + 1) % 4 == 0)
{
// do some functions
}
}
Run Code Online (Sandbox Code Playgroud)