Skip to content

Instantly share code, notes, and snippets.

@lazypower
Created April 14, 2011 23:30
Show Gist options
  • Save lazypower/920831 to your computer and use it in GitHub Desktop.
Save lazypower/920831 to your computer and use it in GitHub Desktop.
Marco, can you read this better than my normal spaghetti?
function EmbedVid(someID)
{
html = $('#embed-template').clone();
html.attr('flashvars','value="file=upload/' + someID + '.flv&image=images/vidThumbs/' + someID + '.jpg"');
html.find('embed').attr('flashvars','file=upload/' + someID + '.flv&image=images/vidThumbs/' + someID + '.jpg"');
// better clear the video holder
$('#video-holder').empty();
$('#video-holder').append(html.children());
}
// wrap this in the document.ready method, so it knows what to attach to
$(document).ready(function()
{
$('.embedLink').click(function()
{
var foo = $(this).attr('title');
EmbedVid(foo);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment