Select to view content in your preferred language

infoWindow with null title behaves differently in IE 7 than other browsers

789
3
07-05-2011 08:37 PM
StephenLead
Honored Contributor
Take the simple infoWindow example and change the infoWindow title declaration to read:

map.infoWindow.setTitle(null);


Run this in FireFox or Chrome, click on the map and note that the infoWindow's title section is minimised (this is my desired outcome).

In Internet Explorer 8 (in Document Mode: IE7 Standards), the title is blank but is not minimised.

This is causing a problem in my site as I am inserting an HTML object into the infoWindow's contents, and it's showing scrollbars in IE (since the empty but maximised Title section is taking up space I need for the HTML object). If I add padding to accommodate this, it looks ugly in every browser except IE7.

Is this a bug? Is there a way to force IE7 to minimise the Title section when it's empty?

Thanks,
Steve
0 Kudos
3 Replies
HemingZhu
Frequent Contributor
Take the simple infoWindow example and change the infoWindow title declaration to read:

map.infoWindow.setTitle(null);


Run this in FireFox or Chrome, click on the map and note that the infoWindow's title section is minimised (this is my desired outcome).

In Internet Explorer 8 (in Document Mode: IE7 Standards), the title is blank but is not minimised.

This is causing a problem in my site as I am inserting an HTML object into the infoWindow's contents, and it's showing scrollbars in IE (since the empty but maximised Title section is taking up space I need for the HTML object). If I add padding to accommodate this, it looks ugly in every browser except IE7.

Is this a bug? Is there a way to force IE7 to minimise the Title section when it's empty?

Thanks,
Steve


You can hide infoWindow title Bar by using
 map.infoWindow.hideTitleBar();
0 Kudos
StephenLead
Honored Contributor
You can hide infoWindow title Bar by using
 map.infoWindow.hideTitleBar();


Nice find - thanks.

The problem is that this also hides the X to close the infoWindow. Is there a way to hide the title bar, but keep the X?

(I've already implemented the ESC key to close the infoWindow as discussed in a previous post, but I think there still should be a way to close it using the mouse).
0 Kudos
HemingZhu
Frequent Contributor
Nice find - thanks.

The problem is that this also hides the X to close the infoWindow. Is there a way to hide the title bar, but keep the X?

(I've already implemented the ESC key to close the infoWindow as discussed in a previous post, but I think there still should be a way to close it using the mouse).


I am not sure how can you keep x while hide title bar. I think x and titlebar share one node. But you can work around by add a x in your content simulate the close function.
0 Kudos