jQuery 手风琴 手风琴change
我为我的网站创建了一个 jQuery 手风琴,一切都运行得很好。 但现在我想在单击手风琴的链接时执行一些 JavaScript。 在 jQuery 文档中,我找到了这个解决方案:
$('ul.accordion').accordion().bind("accordionchange", function(event, something, ui) {
alert('ALLO');
});
Which shouldexecute everytime the Accordion Changes,但直到现在...没有结果(当我单击手风琴链接时没有警报。有人对如何执行此操作有好的提示吗?
I've created a jQuery accordion for my website, it all works very fine. But now I want to have some javascript executed when i click on a link of the accordion. In the jQuery documentation I found this solution:
$('ul.accordion').accordion().bind("accordionchange", function(event, something, ui) {
alert('ALLO');
});
Which should execute everytime the accordion changes, but untill now... no results (no alert when I click on an accordion link. Does anyone have good tips on how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的问题是您尝试将绑定链接到手风琴
您可以在初始化手风琴时创建它 - 演示此处
或者在您创建了手风琴之后
Your issue is your trying to chain the bind to the accordion
You can create it when you initialize the accordion - Demo here
Or later after you have already created the accordion