如果注册的点击事件函数只会被执行一次,可以按下面的写,
$("#id").on('click',function(){
//.......
})
如果注册的点击事件函数可能会被执行多次,请先取消原先的注册事件,避免多次注册,导致点击之后不符合预期效果.
$("#id").off('click').on('click',function(){