I would like to resurrect this month old thread and suggest an
different, (perhaps) simpler approach.
When the infowindow is created, the <div> in which your HTML is added
is (if I interpret the DOM structure shown by Firebug) two child nodes
beneath the <div> which has class="gmnoprint", and there is another
one just above that. In other words, the structure looks like this
.
.
higher nodes
.
.
<div class="gmnoprint" ...
<div class="gmnoprint" ...
... several sibling nodes ...
<div ...
<div <-- this is where your HTML goes
... the rest of your HTML ...
My idea is based on the fact that inline style will override style
specified in a class.
Therefore, why not just stick the following script at the top of your
HTML that goes in the infoWindow::
<script ...>
this.parentNode.parentNode.style.display='block';
this.parentNode.parentNode.parentNode.style.display='block';
</script>
This should set the inline style of the two no-print <div>s to
override the class="gmnoprint"
I'd like to use something like this rather than fooling with the CSS
tables and class definitions which would affect other parts of the
map. I assume those <div>s are set up on the fly, since they give the
absolute position of the infoWindow on the map, so this would not mess
up the map after the infoWindow is closed..
Am I off base here, or should this work?
Thanks
Rg
On Jan 30, 12:34 pm, Brian P <[email protected]> wrote:
> I think that's only if the API CSS uses !important also. If the first
> declaration uses !important and the second doesn't, it will keep the
> first. I didn't think that the Google CSS had !important, so it should
> work.
>
> That link is about how to override a CSS style element that does use !
> important. If Google uses !important, you're right about this. I'm
> just not sure--I didn't think that they do.
>
> -Brian
>
> On Jan 29, 1:58 pm, Marcelo <[email protected]> wrote:
>
> > On Jan 29, 7:23 pm, Brian P <[email protected]> wrote:
>
> > > Ah OK, so _definitely_ use an exclamation point then! That should make
> > > it stick.
>
> > No, timing is essential, and if you use .css, (even with !important),
> > the API will override it because it loads later, so it has the last
> > word:http://stackoverflow.com/questions/462537/overriding-important-style-...
>
> > That's why you have to do it with javascript, after the API has
> > loaded.
>
> > --
> > Marcelo -http://maps.forum.nu
> > --
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.