jquery 手风琴点击标题 img 更改切换
我有一个由图像组成的手风琴菜单组。所有部分在开始时都关闭,当单击/打开其中一个手风琴部分时,我想更改刚刚单击的标题图像的图像源,当然,如果该部分关闭,稍后将其更改回来。我怎样才能将它添加到手风琴中?先感谢您。
html 和 jquery 代码:
$(document).ready(function () {
$("#accordion").accordion({
collapsible: true,
active: false,
header: '.head',
autoHeight: false,
});
});
<div id="accordion">
<div class="head"><a href="#"><img id="head1" src="images/Header1_closed.png" border="0" /></a></div>
<div><img src="images/accordPart3.png" /></div>
<div class="head"><a href="#"><img id="head2" src="images/Header2_closed.png" border="0" /></a></div>
<div><img src="images/accordPart5.png" /></div>
I have an accordion menu group made up of images. All the sections are closed at start, when one of the accordion sections is clicked/opened I want to change the image source of the just clicked header image and of course change it back later if the section is closed. How can I add this to the accordion? Thank you in advance.
The html and the jquery code:
$(document).ready(function () {
$("#accordion").accordion({
collapsible: true,
active: false,
header: '.head',
autoHeight: false,
});
});
<div id="accordion">
<div class="head"><a href="#"><img id="head1" src="images/Header1_closed.png" border="0" /></a></div>
<div><img src="images/accordPart3.png" /></div>
<div class="head"><a href="#"><img id="head2" src="images/Header2_closed.png" border="0" /></a></div>
<div><img src="images/accordPart5.png" /></div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不确定这是否是您真正看到的,但这是我开发的一个名为 Slidorion 的 jQuery 插件,它结合了图像滑块和手风琴。可能值得一看:
http://www.slidorion.com
not sure if this is what your exactly looking from but here's a jQuery plugin I developed called Slidorion which combines and image slider and an accordian. Might be worth checking out:
http://www.slidorion.com