Salman Virk
Salman Virk

Reputation: 12307

In JQuery UI Accordion, How to display two icons for one state?

I have the following icons in JQuery accordion setup:

icons: { 'header': 'ui-icon-plus', 'headerSelected': 'ui-icon-minus' }

Is it possible that I can have two icons at the same time for 'header' instead of just one.

Hence, the question is to display two icons for one 'Header'/'headerSelected' state?

Upvotes: 0

Views: 589

Answers (1)

Salman Virk
Salman Virk

Reputation: 12307

Something like it will work

$('#myAccordion > h3').click(function(){

    if($(this).hasClass("ui-state-active"))
    {
        // insert your image/text
        $this.append("<span id='test'>Hello World</span>");
    }
    else
    {
        $("#test").remove();
    }
});

Upvotes: 1

Related Questions