No Close Button InfoWindow

5662
7
Jump to solution
11-26-2012 08:28 AM
bobmcmichael
New Contributor II
I hope this is posted in the right subforum.

I'm using Arcgis and for some reason the little 'x' close button is not showing up on my info window.  There aren't any errors listed on the page when I go into debug mode in the browser.  I'm using version 2.7 but I have tried different versions to no avail.

The code I use for displaying an InfoWindow:
var template = new window.esri.InfoTemplate(); template.setTitle(self.getPopUpTitleContent); // self = this (yes, it's defined) template.setContent(self.getPopUpTextContent);  self.featureLayer = new window.esri.layers.FeatureLayer(featureCollection, {   mode: window.esri.layers.FeatureLayer.SELECTION_NEW,   id: 'anAwesomeLayer',   infoTemplate: template });            self.map.addLayers([self.featureLayer]); self.map.infoWindow.resize(275,275);



There should be a little 'x' on the right of the title bar:
[ATTACH=CONFIG]19528[/ATTACH]


Any help is greatly appreciated!  Thanks in advance.
1 Solution

Accepted Solutions
TomCohen
Occasional Contributor
Have you got some CSS defined somewhere that might be hiding it?  Or are you missing some CSS?

Use some development tools e.g. firebug (in FF) or the built-in tools in other browsers to examine the element.  If your site is publicly available then perhaps post a link?


Seconded - a very similar thing recently happened to me and it was due to CSS that I'd never seen before (added by another developer). The InfoWindow elements use overly-common class names (e.g. the title bar has the class 'title') and therefore can clash with other CSS in your site. I only saw the problem when I used Chrome's developer tools to inspect the title element then disable all styles one at a time.

View solution in original post

0 Kudos
7 Replies
__Rich_
Occasional Contributor III
Have you got some CSS defined somewhere that might be hiding it?  Or are you missing some CSS?

Use some development tools e.g. firebug (in FF) or the built-in tools in other browsers to examine the element.  If your site is publicly available then perhaps post a link?
TomCohen
Occasional Contributor
Have you got some CSS defined somewhere that might be hiding it?  Or are you missing some CSS?

Use some development tools e.g. firebug (in FF) or the built-in tools in other browsers to examine the element.  If your site is publicly available then perhaps post a link?


Seconded - a very similar thing recently happened to me and it was due to CSS that I'd never seen before (added by another developer). The InfoWindow elements use overly-common class names (e.g. the title bar has the class 'title') and therefore can clash with other CSS in your site. I only saw the problem when I used Chrome's developer tools to inspect the title element then disable all styles one at a time.
0 Kudos
__Rich_
Occasional Contributor III
Seconded

You can use the voting tools on the right-hand side of each post to up-vote stuff you agree with 🙂
0 Kudos
bobmcmichael
New Contributor II
Thanks for the suggestions.  I used Chrome's dev tools to examine the CSS for the title.  All but one of the styles is coming from InfoWindow.css that is hosted at arcgisonline.com.  The only one that is not is a font-size style that I've overridden purposely.

Below is another screenshot I took when examining the element with Chrome's dev tools.  It looks like there is a spot for the close button, but none appears.  I also included the relevant markup.

I'll keep investigating the CSS of the varying levels of divs, etc that make up the infowindow to see if anything comes to light.

It's an internal site so I can't post a link, but thanks for offering to take a look!  Thanks for the help so far!

[ATTACH=CONFIG]19550[/ATTACH]

[ATTACH=CONFIG]19551[/ATTACH]
0 Kudos
bobmcmichael
New Contributor II
AHAAAA! I GOT IT!


It WAS a CSS thing.  Twitter bootstrap was overriding a style!!!

Thank you for all the help!!!
0 Kudos
__Rich_
Occasional Contributor III
AHAAAA! I GOT IT!


It WAS a CSS thing.  Twitter bootstrap was overriding a style!!!

Thank you for all the help!!!


Worth marking one of the replies as the answer then?  😉
0 Kudos
bobmcmichael
New Contributor II
Marked tomfumb's reply as the answer even though many supplied good input.  His suggestion about unselecting the styles one at a time is what helped me the most.
0 Kudos