what-did-they-say/js/toggle-transcript.js
2009-09-13 14:46:02 -04:00

14 lines
446 B
JavaScript

$$('.transcript-bundle').each(function(d) {
var select = d.select("select");
if (select.length == 1) {
select = select[0];
var toggle_transcripts = function() {
d.select(".transcript-holder").each(function(div) {
div.hasClassName($F(select)) ? div.show() : div.hide();
});
};
Event.observe(select, 'change', toggle_transcripts);
Event.observe(window, 'load', toggle_transcripts)
}
});