struts jQuery Accordion:禁止用户遍历
我正在使用 struts jQuery 插件中的手风琴,其中有 3 个手风琴项目。每个手风琴项的底部都有一个按钮,该按钮运行此代码的变体:$("#accordion").accordion('activate', 1);
。我试图想出一种方法来禁用手风琴项目,以便手风琴项目只能通过激活代码打开,或者甚至以某种方式不允许通过该项目上的单击事件打开手风琴项目。
我整个早上都在研究这个问题,发现似乎只能禁用整个手风琴(而不仅仅是特定项目)和事件选项 $( ".selector" ).accordion( "option ", "event", 'mouseover' );
对我来说也根本不起作用,尽管我似乎能够更改其他选项。
有没有更好的方法来做到这一点?
预先感谢您提供的任何帮助
I'm using the accordion in the struts jQuery plugin that has 3 accordion items inside. Each of the accordion items has a button at the bottom, which runs a variation of this code: $("#accordion").accordion('activate', 1);
. I'm trying to come up with a way to either disable the accordion items so that accordion items only open by way of the activate code, or even somehow disallow the ability to open the accordion items by way of the click event on that item.
I've been researching this all morning, and have found that it seems to only be possible to disable the entire accordion (not just specific items), and the event option $( ".selector" ).accordion( "option", "event", 'mouseover' );
also is not working at all for me, although i seem to be able to change other options.
is there a better way to go about doing this??
Thank you in advance for any help you can provide
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最终禁用了手风琴项目的点击事件。
$("#accordion li h3.ui-accordion-header").unbind("点击");
I ended up disabling the click event for the accordion items.
$("#accordion li h3.ui-accordion-header").unbind("click");