I am trying to identify whether a certain png file is placed besides another png file, and if so there will be an alert.
Problem is alert will show up as soon as webpage is loaded.
The code I am using for the png files are:
<div id="container" style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%)">
<div id="donkey">
<img src="images/donkey.png">
</div>
<div id="tail">
<img src="images/donkeytail.png">
</div>
</div>
and the jquery code is:
<script>
$(function() {
$( "#tail" ).draggable();
});
if($("#tail").css({top: 382, left: 810, position:'absolute'})){
alert ('You win');
}
</script>
I used a chrome extension to find those coordinates, which are the coordinates exactly where the tail should be placed.
I am not sure if I am doing this the right way and I'd appreciate any help.
Thanks!