injecting json files to replace text
i've created site injects text symbol when click on symbol.
not being programmer profession, i've come kludge accomplishes goal, i'd love have explain proper way this.
i'm using http://json.fastfrag.org/ convert html tables json files , using fastfrag js convert json file html object.
the existing content in hidden div set nothing because couldn't figure out how replace existing html. (i append work)
new html content appended hidden div can determine height of new content.
the new height of hidden div used adjust height of stage accommodate new html.
the final destination symbol loaded , textbox content replaced html hidden div.
here's code:
$.getjson('maplinkstockton.json', function(data) {
//fastfraq converts json html object
var newhtml =fastfrag.create(data[0]);
//get hidden div datasize
var datasize = document.queryselector('#datasize');
//empty div
datasize.innerhtml='';
//append fastfraq object
datasize.appendchild(newhtml);
//get height hidden div
divheight = $('#datasize').height();
//had photo height , padding create new stage height
newheight = divheight+600+'px';
//adjust stage height
$('#stage').css({'height':newheight});
//get html datasize div
var replacehtml = $('#datasize').html();
//get maptext symbol
var mysymbolobject = sym.getsymbol("maptextsym");
// substitute mapdatatextbox content region html
mysymbolobject.$("maptextbox").html(replacehtml);
});
you can see in action at http://www.jomariworks.com/edge-json/map.html links in hawaii, california, oregon , washington live.
projects files can downloaded @ http://www.jomariworks.com/edge-json/edge-json.zip
in addition cleaning code, wondering how set function available have supply name of json file.
thanks in advance this.
More discussions in Edge Animate CC
adobe
Comments
Post a Comment