Skip to content

Instantly share code, notes, and snippets.

@darkhelmet
Created November 14, 2009 02:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darkhelmet/234339 to your computer and use it in GitHub Desktop.
Save darkhelmet/234339 to your computer and use it in GitHub Desktop.
(function($) {
$.fn.swfembed = function(movie, width, height) {
this.each(function() {
scale = 600 / width;
w = '600px';
h = (height * scale) + 'px';
swfobject.embedSWF(movie, this.id, w, h, '9.0.124', '/swf/expressInstall.swf', null, { wmode: 'opaque', allowFullscreen: true });
});
}
})(jQuery);
$(document).ready(function() {
$('.swfembed').each(function() {
t = $(this);
$(this).swfembed(t.attr('movie'), parseInt(t.attr('mwidth')), parseInt(t.attr('mheight')));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment