deprecated jquery-svg, using jquery+inline SVG

This commit is contained in:
2013-02-12 22:34:25 -05:00
parent eb6b08b233
commit e96147b7ff
7 changed files with 183 additions and 156 deletions

View File

@@ -34,18 +34,20 @@ $(document).ready(function() {
// console.log('svg loaded');
// });
$('div#SVG1').svg({
loadURL: '/images/BlankBody.svg', // External document to load
onLoad: null, // Callback once loaded
settings: {width: '10cm', height: '5cm'}, // Additional settings for SVG element
initPath: ''});
// $('div#SVG1').svg({
// loadURL: '/images/BlankBody.svg', // External document to load
// onLoad: null, // Callback once loaded
// settings: {width: '10cm', height: '5cm'}, // Additional settings for SVG element
// initPath: ''});
var colors = "0f0 0ff f60 f0f 00f f00".split(' '), i=0;
var colors = "0f0 0ff f60 f0f 00f f00".split(' '), i=0;
$(document).on('click', 'g',(function() {
console.log('click ' + this.id);
this.find('path').style.fill = "#"+colors[i++%colors.length];
$(this).children('path').css("fill",'#'+colors[i++%colors.length] +'');
})
);