javascript - How can I go to anchor and open a Bootstrap accordion at the same time? -


i'm using bootstrap accordion , works charm, no problem @ all. however, i'd have link 1 of tabs in accordion. idea once click on link, i'm taken part of teh page (the accordion down in page) , open tab.

so used following:

<a href="#prizes" data-toggle="collapse" data-parent="#accordion"><i class="mdi-action-info"></i></a> 

which should work. , in part: opens accordion tab right, however, page doesn't scroll anchor should. stays in same position, opening accordion.

any idea how fix it? have found answers related jquery ui accordion nothing bs accordion (and jquery ui answers didn't work either), don't know why isn't working

you can manually so:

<a href="#accordion" id="my-link" class="btn btn-primary">open group 2</a> 

js

$('#my-link').click(function(e) {     $('#collapseone').collapse('hide');     $('#collapsetwo').collapse('show');         }); 

fiddle


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -