Script:
$(function() {
$('#main h1,#main h2').media(function(el, options) {
options.caption = false;
options.height = /h1/i.test(el.tagName) ? 75 : 45;
options.src = 'itc_century.swf';
options.flashvars.txt = $(el).text();
options.bgColor = '#ffffcc';
});
});
Markup:
<script type="text/javascript" src="jquery-1.2.3.js"></script>
<script type="text/javascript" src="http://github.com/malsup/media/raw/master/jquery.media.js?v0.92"></script>
...
<h1>First Heading</h1>
Content beneath the first heading
<h1>Second Heading</h1>
Content beneath the second heading
<h2>Third Heading</h2>
Content beneath the third heading