samedi 25 octobre 2014

Using jQuery in Snap SVG load function


Vote count:

0




So I have this problem. I would like to make a page with Snap library, but I didn't find any way to select all of elements, except for the one that I am f.e. hovering over. JQuery should be good for this stuff, but I don't know how to run it in the SVG Snap load function :/ My code is:



<script>
var s = Snap("#svg");
Snap.load("fin.svg",onSVGLoaded);

function onSVGLoaded(d){
var all = d.selectAll(".plasmid");
s.append(all);
var mono = s.select("#mono");
mono.drag();

$(mono).click(function(){
$(this).fadeOut("slow");
});
};
</script>


Where fin.svg is the external svg file, .plasmid is a class in the svg file, with all the parts of the graphics and mono is one part of the graphics. The mono.drag() part is working, but jQuery stuff is not. Can you help?



asked 39 secs ago







Using jQuery in Snap SVG load function

Aucun commentaire:

Enregistrer un commentaire