jQuery less than function with add and remove classes
I'm trying to add and remove classes before and after the width set, Once
width is less than 1140 the addclass and remove classes work perfectly but
when the with is more than 1140 remove class and add class dosnt work. If
I could get any help I'd really and truly aprecaite it.
var $window = $(window),
$html = $('.studio .thirtyheight'),
$htmltwo = $('.studio .sixtyheight');
if ($window.width() < 1140) {
return
$html.addClass('workfullheight').removeClass('thirtyheight'),
$htmltwo.addClass('workfullheighttwo').removeClass('sixtyheight');
}else{
$html.removeClass('workfullheight').addClass('thirtyheight'),
$htmltwo.removeClass('workfullheighttwo').addClass('sixtyheight');
}
$window
.resize(resize)
.trigger('resize');
No comments:
Post a Comment