取消 jQuery UI Accordion 部分打开
我使用 jQuery UI 手风琴小部件,我想知道是否可以使用手风琴的 changestart
事件取消打开操作。来自文档:
// This event is triggered every time the accordion starts to change.
$( ".selector" ).accordion({
changestart: function(event, ui) { ... }
});
并且 event
包含 result
属性。我想我可以使用这个属性来取消事件,但是我必须使用什么值?如果这是错误的方式,我该如何以其他方式实现它?
I use jQuery UI accordion widget, and I wonder if it is possible to cancel opening action using accordion's changestart
event. From documentation:
// This event is triggered every time the accordion starts to change.
$( ".selector" ).accordion({
changestart: function(event, ui) { ... }
});
And event
contains result
attribute. I guess I can use this attribute to cancel event, but what value I have to use? And if it's the wrong way, how I can accomplish it another way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只需在
create
事件上加载内容...这会在创建手风琴时将数据加载到 div 中。或者您可以在制作手风琴之前在页面加载上加载内容
,或者您可以发送整个 html,然后
在任何情况下将其制作为手风琴,如果您需要定期刷新数据,则在加载时加载 div 内容某个点,并设置超时来加载新数据。
You could just load the content on the
create
event...this would load the data into the div when the accordion is created.or you could probably load the content on page load before you make the accordion
or you could send the whole html over and then make it an accordion
in any case, if you need to refresh the data periodically, then load the div contents on load at some point, and setup a timeout to load the new data.