Hi Edith, --- In [email protected], "csorba_edith" <[EMAIL PROTECTED]> wrote: > > Hi, > I was trying to implement a mouseover effect on my SVG map - to view > the name of the feature the mouse points at on a line - and I was > using the following .js code: > function viewInfo(evt) { > var infoLine = document.getElementById("infoNote"); > text= infoLine.getFirstChild; > var note= evt.getTarget.getAttributeNS(null,"name"); > text.setData(note); > }
evt.getTarget.... is wrong and should be evt.target.... and it should be infoLine.firstChild and not infoLine.getFirstChild() - note that you omitted the (), as this is a method. I am surprised that it works at all in ASV. Are you sure it doesn't give any error messages? That way it works in all viewers and browsers. See also http://jwatt.org/svg/authoring/ > It functions OK in IE, but Opera/Firefox does not read this function > and Batik gives me an error: > "viewinfo is not defined" > The same is the situation with the .js code I use to check the > visibility of a layer (so it can be turned on/off): > function viewLayer(name) { > theLayer = document.getElementById(name); > theVisibility = theLayer.getAttributeNS(null,"visibility"); > if (theVisibility == "visible") { > theLayer.setAttributeNS(null,"visibility", "hidden"); > } > else if (theVisibility == "hidden") { > theLayer.setAttributeNS(null,"visibility", "visible"); > } > } I don't see what's wrong here. In case you want to display your attributes as tooltips, I provide a tooltip script at http://www.carto.net/papers/svg/gui/mapApp/ , see example at http://www.carto.net/papers/svg/gui/tooltips/ Andreas ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

