当前位置:首页>开发>正文

jquery怎样自定义csshooks

2023-06-07 08:10:45 互联网 未知 开发

 jquery怎样自定义csshooks

jquery怎样自定义csshooks

事实上我们可以通过bind绑定一个自定义事件,然后再通过trigger来触发这个事件。例如给element绑定一个hello事件,再通过trigger来触发这个事件:

//给element绑定hello事件
element.bind("hello",function(){
    alert("hello world!")
})

//触发hello事件
element.trigger("hello")

最新文章