Files
dojo/public/home/podcast/podcast.js
2019-03-14 03:19:54 -06:00

19 lines
515 B
JavaScript
Executable File

var sources;
d3.json( "/json/podcast/podcast.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
);
}
});
});