-1

I have some javascript code inserted already and i know it's incomplete. I just want to know where to put it in order for it to become active. This is the svg that i have, of a county in virginia, and i am trying to make it fade in and out of the page. This website is asking me for more information but i feel like i have given all that i can. Also, this is the complete code that i have, there is nothing more.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.0"
width="84.470001"
height="48.330002"
sodipodi:version="0.32"
inkscape:version="0.48.2 r9819"
sodipodi:docname="va.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
id="svg3127"
transform="translate(200,-100) rotate(10)"
>
**<script type="text/javascript">
 $(function() {
  $("#visible".click(function() {
    $('#invisible').toggleClass("show");
  });
 });

</script>
<style>

.hide{display:none;}
.show{display:block;}
 </style>**
<metadata
 id="metadata3129">
<rdf:RDF>
  <cc:Work
     rdf:about="">
    <dc:format>image/svg+xml</dc:format>
    <dc:type
       rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
  </cc:Work>
 </rdf:RDF>
</metadata>
<defs
 id="defs3131" />
<sodipodi:namedview
 fill="#A9A9A9"
 pagecolor="#ffffff"
 bordercolor="#666666"
 borderopacity="1"
 objecttolerance="10"
 gridtolerance="10"
 guidetolerance="10"
 inkscape:pageopacity="0"
 inkscape:pageshadow="2"
 inkscape:window-width="1366"
 inkscape:window-height="716"
 fit-margin-top="0"
 fit-margin-left="0"
 fit-margin-right="0"
 fit-margin-bottom="0"
 inkscape:zoom="6.4335112"
 inkscape:cx="38.957601"
 inkscape:cy="17.76589"
 inkscape:window-x="-8"
 inkscape:window-y="-8"
 inkscape:window-maximized="1"
 inkscape:current-layer="svg3127"
 id="namedview3133"
 showgrid="false" />
<path
 style="font-size:12px;fill:#d0d0d0;fill-opacity:1;fill- 
rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke- 
linejoin:bevel;stroke-miterlimit:4;stroke-opacity:1;stroke- 
dasharray:none;marker-start:none"
 d="m 78.821553,15.007566 3.672,-1.249 -0.347,0.984 -0.789,1.297 
-0.279,0.055 -0.082,0.058 -0.026,0.032 -0.032,0.035 -0.063,0.077 -0.04,0.064 
-0.041,0.063 -0.037,0.058 -0.139,0.289 -0.18,0.476 -0.298,1.362 -0.035,0.248 
-0.258,2.872 0.041,0.112 -0.514,0.23 -0.883,0.068 -0.068,-0.046 
-0.041,-0.095 0.014,-0.031 0.059,-0.041 0.081,-0.135 -0.053,-0.523 
-0.569,-0.23 -0.975,0.29 -0.058,-0.109 -0.012,-0.068 0.062,-0.495 
 0.091,-0.321 0.672,-2.001 0.468,-0.689 0.162,-0.217 0.047,-0.094 
 0.17,-0.506 0.008,-0.157 -0.058,-1.018 0.33,-0.645"
 id="Accomack"
 inkscape:connector-curvature="0" />
</svg>
Matthew
  • 83
  • 6

1 Answers1

0

To answer your specific question: the <script> element can go anywhere in your SVG. It doesn't really matter where you put it.

Where you have it, should work. Once you remove the asterisks and fix your issue with the missing jQuery script.

Paul LeBeau
  • 97,474
  • 9
  • 154
  • 181