Files
dojo/public/home/podcast/jsPodcast.js
2018-07-13 19:06:08 -05:00

19 lines
514 B
JavaScript
Executable File

var sources;
d3.json( "home/podcast/jsonPod.json",function(d){
d3.select("#audioframe").attr("src",d[0].source);
sources=d;
});
d3.selectAll("p.ctitle").on('click', function(){
var this_id=d3.select(this).attr("value");
sources.forEach(function (d){
if(d.id == this_id){
d3.select("#audioframe").attr("src",d.source);
window.scroll(0,
d3.select("#sframe").node().getBoundingClientRect().top -
d3.select("#stitle").node().getBoundingClientRect().top
);
}
});
});