So I've been able to check if two images have the same top css value with:
if($('#pic').top == $('#pic1').top){
alert("You lose");
}
But I want to check if they overlap, so they will not necessarily have the same top value. So, I've tried this:
if(parseInt($('#pic').top) < parseInt($('#pic1').top) + 99){
alert("You lose");
}
It does not work. How can I fix this? Note: I am using 99 because the height of the images are 100.