N
N
noname12015-10-22 02:14:31
Bootstrap
noname1, 2015-10-22 02:14:31

So that accordion bootstrap doesn't collapse automatically, but only on link click?

Guys, tell me, please, what to write in the script so that the bootstrap accordion does not collapse automatically, but only when the link is clicked?
PS: markup and main styles from BOOTSTRAP 3
Titlt1
content...
lnk
Titlt1
content...
lnk
Titlt3
content...
lnk

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
noname1, 2015-10-22
@noname1

I found a similar one, but it works every other time ... maybe you can somehow finish it or ..?

$(document).ready(function(){
        $('#accordion').on('shown.bs.collapse',function(){
            $('.in',$(this)).removeClass('in').addClass('show');
        });

        $('#accordion').on('show.bs.collapse',function(e){
            if($(e.target).hasClass('show')){
                $(e.target).removeClass('show').addClass('in');
                $(e.target).collapse('hide');
                e.preventDefault();
            }
        });
    });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question