L
L
love_fishing2018-06-29 11:27:47
css
love_fishing, 2018-06-29 11:27:47

How to raise a block to the top of the screen when clicking on a tab in this block?

Hello.
Landing page. There are bootstrap tabs in the middle of the page.
When you click on a tab, the information corresponding to the tab opens below. Everything is standard.
The essence of the problem is that, since tabs are in the middle of the style, when you click on the tab, the information that opens goes beyond the bottom edge of the screen and you have to lift the page to read the information.
How can I make it so that when I press the tab tab, I have a block with tabs, in addition to opening the tab, it rises to the top of the screen and all the information would be in front of the user's eyes and he would not have to scroll up with the mouse wheel to read her?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2018-06-29
@love_fishing

$('.tab').click(function(){
  $('html, body').stop().animate({ scrollTop:$('.tabs').offset().top}, 500);
});

tab is a tab
tabs is a block where you need to climb

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question