V
V
Vladislav Altyncev2015-10-01 18:47:03
JavaScript
Vladislav Altyncev, 2015-10-01 18:47:03

How to make the height of the parent block depending on the child?

Good afternoon.

There is such a menu
codepen.io/npofopr/pen/QjdzKP

Now there is this:

$('.cd-secondary-nav', this).each(function(){
  var height = $(this).height();
   $('.sl_catalog').css('height', height+250);
});


But this is nonsense. In fact, there are many such classes.
And how to make it so that when going inside the menu, it sets the desired height to the main item so that there is no scrolling.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2015-10-01
@Stalker_RED

And with height, everything is fine. In your example, a horizontal scroll.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question