[OpenLayers-Users] tooltips for Controls?

David Fawcett david.fawcett at gmail.com
Tue Jan 22 09:25:29 EST 2008


I am pretty sure that 'title' works in both IE and FireFox.  It seems like
for quite a while, people were using the 'alt' tags for this purpose.  They
only show mouse-over text in IE.

David.

On Jan 21, 2008 4:16 PM, Linda Rawson <linda.rawson at gmail.com> wrote:

> I did this in the
>
> redraw:
> method of the panel.js itself with the following lines but it is a total
> hack and only for my application:
>
> var ctrlName = this.controls[i].CLASS_NAME.replace("OpenLayers.",
> "").replace("Control.","");
> var title = null;
>
> if (ctrlName == "ZoomBox") {
>   title = "Zoom to Location";
> };
> if (title != null) {
>   element.title = title;
> }
> this.div.appendChild(element);
> A title would be great as well as the ability to hide/show a control.
>
> My understanding is that this title attribute is only good in IE.
>
> Linda Rawson
> On Jan 21, 2008 2:33 PM, Gregor Mosheh <gregor at hostgis.com> wrote:
>
> > This one sounded easer than it turned out to be. :)
> >
> > HTML elements can have a title attribute, and most browsers will show
> > that text when the mouse hovers over the element.
> >
> > How may I apply this to OL Controls? I tried a few of the more obvious
> > approaches, such as adding "this.div.title = 'Pan the map'" in
> > initialize() but to no avail.
> >
> > Is this non-trivial to do? Is a 'title' param something that would be
> > useful to add to Control itself for making a general solution to this?
> >
> > --
> > Gregor Mosheh / Greg Allensworth, BS, A+
> > System Administrator
> > HostGIS cartographic development & hosting services
> > http://www.HostGIS.com/ <http://www.hostgis.com/>
> >
> > "Remember that no one cares if you can back up,
> >  only if you can restore." - AMANDA
> > _______________________________________________
> > Users mailing list
> > Users at openlayers.org
> > http://openlayers.org/mailman/listinfo/users
> >
>
>
>
> --
> Linda Rawson
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080122/3b7681e3/attachment.html


More information about the Users mailing list