I wan to run a function on div height change, I want to add a class to body if div height increased and remove the class if height decrease to 0
.
Something like:
$('.mydiv').change(function(){
// add class to boy if height increase
})
I wan to run a function on div height change, I want to add a class to body if div height increased and remove the class if height decrease to 0
.
Something like:
$('.mydiv').change(function(){
// add class to boy if height increase
})
$('.mydiv').resize(function() {
if($(this).height() > 400){
$('body').removeClass('normal height bigheight').addClass('bigheight');
} else if ($(this).height() > 200){
$('body').removeClass('normal height bigheight').addClass('height');
} else if ($(this).height() > 0){
$('body').removeClass('normal height bigheight').addClass('normal');
} else {
$('body').removeClass('normal height bigheight');
}
});