Reputation: 16049
By default, a Google Map infowindow has really nasty style, such that the inner content overlaps the close button when a scrollbar is present:
Google, by their infinite wisdom, don't do anything as nice as using classes on their elements, so that makes styling the info window very difficult. Does anyone know how I can fix this overlap problem?
Upvotes: 2
Views: 980
Reputation: 31
You will need to wait until google has created the content before you try and manipulate the CSS.
google.maps.event.addListener(marker, "click", function () {
infoWindow.open(googleMap, this);
setTimeout(reposition, 500);
});
function reposition() {
$(SELECTOR FOR YOUR CONTENT DIV).parent().parent().css({ top: '24px'});
}
Upvotes: 3
Reputation: 92772
Insert your own div
with id and class into the window and style it; if you want even more control, get its parent (through document.getElementById("yourdiv").parent
) and manipulate its CSS through DOM (e.g. reset the overflow
property).
Upvotes: 0