I am using this relatively simple code:
var height = help ? 'minus' : 'plus';
var prop = $('#properties');
if(height == 'minus'){
prop.height(prop.height() -= 206);
} else {
prop.height(prop.height() += 206);
}
It fails on both lines that do the adding/subtracting! Any ideas?
The
-=operator equalsoperand = operand - valuewhich in your case would look likewhich obviously will fail. You just need the minus operator to accomplish that task.
will do it.