Reputation: 1094
I have a div class="container
that I would like to add to <div class="second-menu-it">
if the screen size is less than 959px:
Below is the code i am trying to use:
$(window).on('resize', function() {
if($(window).width() < 959) {
$('.second-menu-it').addClass('container');
})
Upvotes: 3
Views: 5725
Reputation: 161
You forgot the }
after the addClass
$(window).on('resize', function() {
if($(window).width() < 959) {
$('.second-menu-it').addClass('container');
}
});
Upvotes: 3