I have used a bit of jQuery to fire an if function. When I try to simplify the equation using vanilla javascript's ternary operands it doesn't seem to work.
What am I doing wrong?
if(windowBottom > objectBottom) {
$(this).animate({opacity: '1'}, 1500);
$(this).addClass('item-play__right');
}
//works fine
windowBottom > objectBottom ? $(this).animate({opacity: '1'}, 1500).addClass('item-play__right');
//doesn't work