Note that there are some explanatory texts on larger screens.

plurals
  1. POerror in changing title property of nodes in vector graphics using jquery
    primarykey
    data
    text
    <p>I have a graph in SVG format, and I wanted to implement a functionality that changes the title property of any node when the mouse pointer hovers over it, and back to the old title when the pointer moves away. To implement this, I'm trying to use the jQuery library and my code looks like this:</p> <pre><code>var oldTitle; $(document).ready(function() { $("g[class=node]").hover(funciton() { oldTitle = $(this).prop("title"); $(this).prop("title", "New Title!"); }, function() { $(this).prop("title", oldTitle); } ); }); </code></pre> <p>However, for some reason the code is not functioning and I cannot see the expected effect. Any ideas as to what is going wrong here?</p> <p>EDIT: I think I have an idea of what the problem is, but am still looking for a solution to it. So, in the vector graphics html code, a node is represented as:</p> <pre><code>&lt;g id="node2" class="node"&gt;&lt;title&gt;SomeTitle&lt;/title&gt; &lt;ellipse fill="forestgreen" stroke="forestgreen" cx="243.017" cy="-678" rx="27" ry="18"/&gt; &lt;text text-anchor="middle" x="243.017" y="-674.3" font-family="Times New Roman,serif" font-size="14.00"&gt;b&lt;/text&gt; &lt;/g&gt; </code></pre> <p>Now, I want the hover action to change the text between <code>&lt;title&gt; ... &lt;/title&gt;</code> and change it back when the mouse pointer moves away.</p> <p>Any help on how this can be acheived?</p> <p>PS: $(this).prop("title") returns undefined, so title out here is not a property of the node element.... then, what is it? And how can it be changed?</p> <p>Thanks a lot!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload