In my html I have
<div id="map"></div>
#map {
width: 100%;
height: 100%;
background-color: #CCC;
}
that gets dynamically filled with several divs like the following
<div class="basicTiles1" style="left: 8128px; top: 8128px;"></div>
.basictiles1 {
position: absolute;
width: 64px;
height: 64px;
background-image: url(<snip urlToPng>);
background-position: 0px 0px;
}
Then an onmousedown event is added to #map like so
$('#map').on('mousedown', function(){console.log("mousedown");});
The event is never triggered. If I don't add the tiles to the map, it works.
I tried doing it with jquery's 'on', 'onmousedown', javascripts 'addEventListener'. The script doesn't have any compilation errors. The event just doesn't seem to trickle down.
Is it because the tiles are position absolute? Is it because they are added dynamically?