hmrupp wrote:
> What is the right way to display tooltips over objects? My problem is 
> that my code (and any example of tooltips I have so far looked at) 
> does only work at zoom-level 0. When you zoom in the toolstips are 
> way of. I have found one example which correctly displays tooltips on 
> different zoomlevels. They use the mousemove event.
> http://svglbc.datenverdrahten.de/?code=tooltip&znr=on
> Somehow I cannot transfer this to mouseover.

I believe your code doesn't take in account the current scale.
If you look at http://svg-whiz.com/svg/Tooltip.svg code, you will see a 
function that corrects the coordinates:

function GetTrueCoords(evt)
{
    // find the current zoom level and pan setting, and adjust the reported
    //    mouse position accordingly
    var newScale = SVGRoot.currentScale;
    var translation = SVGRoot.currentTranslate;
    TrueCoords.x = (evt.clientX - translation.x)/newScale;
    TrueCoords.y = (evt.clientY - translation.y)/newScale;
};

All the tooltip samples I saw use mouvemove (and mouseout) and not 
moveover, why do you want to do differently?

The advantage of mousemove is that you can listen to this event on the 
whole document, instead of having to repeat the onmouseover event on 
each element. You can then choose to display a tooltip based on various 
criterions, like a regular expression on the id, the fact the element as 
a desc or title element inside, etc.

-- 
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  For servers mangling my From and Reply-To fields,
--  please send private answers to PhiLho(a)GMX.net
--  --  --  --  --  --  --  --  --  --  --  --  --  --


-----
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/
 



Reply via email to