Is this the simplest way simulate something similar to
ALT text in standard HTML?
--- Jerome de la Goutte <[EMAIL PROTECTED]> wrote:
> Hi
>
> Yes, this was a very simple example.
> You could change the ShowData function to something
> like that:
>
> function ShowData(evt)
> {
> //set visible the text element
> document.getElementById('MyText').setAttribute
> ('visibility','visible')
>
> //get the name of the rect
> var rectName=evt.target.getAttribute('id')
>
> select what will be the data of the text element
> var textData
> switch (rectName)
> {
> case "rect1" :
> {
> textData="first rect";
> break;
> }
> case "rect2" :
> {
> textData="second rect";
> break;
> }
> case "rect3" :
> {
> textData="third rect";
> break;
> }
> }
>
> //set the data of the text
>
>
document.getElementById('MyText').firstChild.data=textData
> }
>
>
> For that, you have to set 'id' attribute for any
> rect. In my case, I
> named them rect1 to rect3, but you can change their
> name, of course.
>
> Jerome
>
>
> --- In [EMAIL PROTECTED], [EMAIL PROTECTED]
> wrote:
> >
> > Hi jerome,
> > i try to do that you suggest me.It's work but
> i've one problem.
> > if i've more than one rect and i want to show text
> on each rect,
> > how i can do it.
> > thanks
> in advance
> > ?xml version="1.0" encoding="utf-8"?>
> > <svg width="400px" height="400px" viewbox="0 0 400
> 400"
> > xmlns:xlink="http://www.w3.org/1999/xlink">
> > <rect x="54" y="266" width="37" height="94"
> fill="Red"
> stroke="black"
> > stroke-width="1" class=""
> onmouseover="ShowData(evt)"
> > onmouseout="HideData(evt)" />
> > <rect x="194" y="173" width="37" height="187"
> fill="Red"
> stroke="black"
> > stroke-width="1" class=""
> onmouseover="ShowData(evt)"
> > onmouseout="HideData(evt)"/>
> > <rect x="91" y="220" width="37" height="140"
> fill="Blue"
> stroke="black"
> > stroke-width="1" class=""
> onmouseover="ShowData(evt)"
> > onmouseout="HideData(evt)"/>
> >
> > <text id="MyText" x="54" y="260"
> visibility="hidden">Hello
> > World</text>
> >
> > <script type="text/javascript">
> > <![CDATA[
> >
> > function ShowData(evt)
> > {
> > document.getElementById('MyText').setAttribute
> > ('visibility','visible')
> > }
> >
> > function HideData(evt)
> > {
> > document.getElementById('MyText').setAttribute
> > ('visibility','hidden')
> > }
> > //]]>
> > </script>
> > </svg>
> >
> >
> >
>
>
>
> > "Jerome de
> la
>
>
> > Goutte" To:
> svg-
> [EMAIL PROTECTED]
>
>
> > <[EMAIL PROTECTED]
> cc:
>
>
> > ue.fr>
> Subject: [svg-
> developers] Re: Show Data when
> mouseover
> >
>
>
>
> > 09/14/2004
> 02:45
>
>
> >
> PM
>
>
> > Please respond
> to
>
>
> > svg-
> developers
>
>
> >
>
>
>
> >
>
>
>
> >
> >
> >
> >
> > Hi
> >
> > for example, you can have the following SVG:
> > <svg>
> > <rect x="54" y="266" width="37" height="94"
> fill="Red"
> > stroke="black" stroke-width="1" class=""
> onmouseover="ShowData(evt)"
> > onmouseout="HideData(evt)">
> > <set attributeName="fill" to="blue"
> begin="mouseover"
> > end="mouseout"/>
> > </rect>
> > <text id="MyText" x="10" y="10"
> visibility="hidden">Hello
> > World</text>
> > <script><![CDATA[
> > function ShowData(evt)
> > {
> >
> document.getElementById('MyText').setAttribute
> > ('visibility','visible')
> > }
> >
> > function ShowData(evt)
> > {
> >
> document.getElementById('MyText').setAttribute
> > ('visibility','hidden')
> > }
> >
> > ]]></script>
> > </svg>
> >
> >
> > This is an example, of course
> >
> > J�r�me
> >
> >
> > --- In [EMAIL PROTECTED],
> [EMAIL PROTECTED]
=== message truncated ===
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/1U_rlB/TM
--------------------------------------------------------------------~->
-----
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/