jQuery手风琴图像更改. [英] JQuery accordion image change.

查看:87
本文介绍了jQuery手风琴图像更改.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我是jquery新手.如何在JQuery手风琴代码上给div赋予不同的图像和样式.当用户单击"Header"手风琴显示器时,我也想这样做,并且Header图像也更改为"Open".单击标题图像更改时,它显示为关闭".
jQuery可以正常工作,但是我不知道在哪里写什么代码来更改图像.

请帮我.

Hi guys,
I am new to jquery. how can i give different image and style to my div on JQuery accordion code. i want to do when user click on Header accordion display and also header image is change to "Open". while it click header image change it shows "Close".
jQuery work fine but where and what code i write for changing image that don''t know.

please help me for that. thanks in Advance.

推荐答案

实际上,有很多方法可以通过使用JQuery来完成.其中之一可以是以下内容:

1.将图像添加到手风琴的标题部分.请确保通过名称或类或IDS识别它们.
2.在您的手风琴的Header部分添加一个click事件.
2.在click事件中,可以使用jQuery的hide和show方法显示或隐藏图像.

There are actually lots of ways on how you can accomplish this by using JQuery. One of which can be the following:

1. Add the images on the header sections of your accordion. Be sure to identify them by name or classes or IDS.
2. Add a click event to the Header sections of your accordion.
2. Inside the click event, you can use the hide and show methods of jQuery to show or hide the images.


(.header_section").click( function(){
(".header_section").click( function(){


(#closeImg").hide("Blind");
("#closeImg").hide("Blind");


这篇关于jQuery手风琴图像更改.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆