I have a menu (.navigation) that I would like to hide instead of wrapping on next line if the screen width is small. But I can't figure out how to use javascript/jQuery to detect if the wrapping has occurred (and hide the navigation).
I cannot use media query becase it is based on specific width when the navigation will be collapsed.
How can i solve this?
.container {
padding: 15px;
background: lightgrey;
}
.navigation {
float: right;
}
.navigation a {
margin-left: 15px;
}
<div class="container">
COMPANY LOGO
<div class="navigation">
<a href="#">Home</a>
<a href="#">About us</a>
<a href="#">Products</a>
<a href="#">Pricing</a>
<a href="#">Contact</a>
</div>
</div>