• Anonymous User 13716511

    (@anonymized-13716511)


    I would like to show a ‘+’ image next to the question when the answer is hidden and have it change to ‘-‘ when the answer is showing. I can add the ‘+’ as a ‘background-image’ in css but I don’t know how to make it change to ‘-‘ when the answer is showing?

    https://www.ads-software.com/plugins/q-and-a/

Viewing 1 replies (of 1 total)
  • Hi guys,

    i just needed this function also for one of my project, here is my quick solution :

    A bit off css
    `a {
    background: transparent url(img/sprites.png) -50px 0 no-repeat;
    padding-left: 25px;
    &.active {
    background-position-y: -26px;
    }
    }`

    a bit of javascript :

    if ($('.faq-list').length >0) {
                $('a.qa-faq-anchor').on('click', function(event) {
                    $(this).toggleClass('active');
                });
            }

    Hope that help,

    Cheers

Viewing 1 replies (of 1 total)
  • The topic ‘Change image on open and close’ is closed to new replies.