Skip to content

Instantly share code, notes, and snippets.

@jdalsem
Created January 11, 2019 08:30
Show Gist options
  • Save jdalsem/d2dc92be521362ea4d96aa43cfc12a8d to your computer and use it in GitHub Desktop.
Save jdalsem/d2dc92be521362ea4d96aa43cfc12a8d to your computer and use it in GitHub Desktop.
youtube z-index fix
//Fix z-index youtube video embedding
$("iframe").each(function() {
var url = $(this).attr("src");
if (!url) {
return;
}
var parts = elgg.parse_url(url);
var args = {};
if (parts['host'] !== undefined) {
if (parts['query'] !== undefined) {
args = elgg.parse_str(parts['query']);
}
args["wmode"] = "transparent";
var split = url.split('?');
base = split[0] + '?';
url = base + jQuery.param(args);
$(this).attr("src", url);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment