M
M
machno2014-10-31 11:05:27
css
machno, 2014-10-31 11:05:27

How to implement the transition to the tab by link (bootstrap 3)?

There is a page with three tabs. Tabs have id: s1, s2, s3.
Navigating through tabs on the page works, but if you enter site.ru/index.html#s3 in the address bar, then the transition to the tab does not occur. How would you implement it? Google didn't help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Facetrollex, 2014-10-31
@Facetrollex

Alternatively:
scrollTo

D
Denis, 2015-07-03
@Soladiem

You can also try something like this

var loc = window.location.hash;

  if (loc) {
    $('#tabs a[href="' + loc + '"]').tab('show');
  }

where #tabs is the id of the list with tabs (but bootsrap used tabs)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question