Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用该.button()方法来设置按钮和其他输入元素的样式。
.button()
但是当我使用 javascript 创建任何其他按钮时,我需要.button()再次调用该方法。
jQuery UI 能否像方法一样自动设置样式.live()(可以自动设置事件)。
.live()
不幸的是,据我所知,这是不可能的。
如果您发现自己必须在.button()任何地方编写代码,请考虑自己编写一个函数来封装该行为。
我想说这个小插件会帮助你:
http://brandonaaron.net/code/livequery/docs
但是我没有任何机会使用最新的 jquery 版本对其进行测试。