how to show/hide SVG groups by ID with jqMobi

597 views Asked by At

I'm working on an interactive iBook and want to be able to show/hide layers of an SVG map as the user moves the handle on a range slider. The SVG file, which I exported from Illustrator CS6, shows the map layers as groups with unique IDs, such as . Before inserting the SVG file (using object tag--see below) into my HTML5 doc, I tested the code by showing/hiding p elements as placeholders for the map layers, and it worked fine. But I'm not able to address the SVG groups in the same way. Would appreciate any assistance. Thx.

from the HTML:

<div id="mapreveal">
<object data="rainshadowMap.svg" type="image/svg+xml" width="600" height="860">
</object>
</div>

from the SCRIPT:

function showOnMap(value) {

if(value>=1910){
$('#a10').show();
$('#t10').show();
}else if(value<1910){
$('#a10').hide();
$('#t10').hide();
}

if (value>=1913){
$('#a13').show();
$('#t13').show();
}else if(value<1913){
$('#a13').hide();
$('#t13').hide();
}
0

There are 0 answers