Hello. I have 6 links on a page to an mp3.
The plugin I installed replaces those links with a swf and plays that mp3 inline.
The problem I had was that it was possible to activate all 6 links and have all audio playing at once. I solved that problem (I feel in a clumsy novice way though) by catching the < a > tag before it was replaced with the embed tag and then putting it back when another one was clicked.
However, this is my problem now: the < a > tag I put back looses it's onClick event (i think that's what is happening) and so, if clicked a second time, fails to switch like the first time.
$(".storyplayer a").bind("click", function() {
// replace the <a> tag from the previous media player installation
if (previousplayerlocation != null) {$("#" + previousplayerlocation + " .storyplayer").html(graboldcode);}
// now remember this installation's <a> tag before it's replaced
graboldcode = $(this).parent().html();
// remember where I grabbed this <a> tag from
previousplayerlocation = $(this).parents("div.storylisting").attr("id");
// replaces the <a> tag with the media player.
$(this).media({width: 190,height: 30});
return false;
});
I am asking if there is a way to re-assign the click event to the "if" statement? Thanks!