javascript - How do I change accordion header with plus and minus symbol? - Stack Overflow

I don't like the default Accordion icons and I want to change them. This link here:shows the optio

I don't like the default Accordion icons and I want to change them. This link here:

shows the option to change the header but it requires to specify icons. I don't need icons. I just need a simple (+) and (-)

How can I do that with accordions?

I don't like the default Accordion icons and I want to change them. This link here:

http://jqueryui./demos/accordion/#option-header

shows the option to change the header but it requires to specify icons. I don't need icons. I just need a simple (+) and (-)

How can I do that with accordions?

Share Improve this question asked May 19, 2012 at 3:11 Tim TomTim Tom 2,1626 gold badges27 silver badges39 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

Hiya working sample demo http://jsfiddle/zM5Vj/ or http://jsfiddle/zM5Vj/show/

Hope this helps, + will be shown when accordion is collapsed where as - in case of open accordion.

have a nice one!

Jquery code which adds + and - accordingly Rest full code is in fiddle, If you want I can copy paste the whole code. Please let me know how it goes!

$(function(){
 $('#accordion .fullChild>a.opener').text('+').addClass('box');

  $('#accordion .opener').click(function() {
  if($(this).text() == "-") {
  $(this).text("+");
  }
  else {
  $('#accordion .opener').text("+");
  $(this).text("-");
  }
});
});

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745524564a4631411.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信