您可以像这样向 jTubeEmbed 插件添加一个新选项:http: //jsfiddle.net/aFx29/2/
变化:
jTubeEmbed: function(video, options) {
var options = $.extend({
// Embed Options
width: 560,
height: 340,
wmode: 'window', // can be window, transparent and opaque
// Player Options
autoplay: false,
fullscreen: false,
related: true,
loop: false,
keyboard: true,
genie: false,
border: false,
highdef: true,
start: 0
}, options);
// ... ommitted for brevity ...
if(options.wmode) {
videoEmbed += '<param name="wmode" value="' + options.wmode + '"></param>';
}
if(options.fullscreen == true) {
videoEmbed += '<param name="allowFullScreen" value="true"></param>';
}
videoEmbed += '<embed src="'+videoUrl+'"';
videoEmbed += ' type="application/x-shockwave-flash"';
if(options.wmode) {
videoEmbed += ' wmode="' + options.wmode + '"';
}
if(options.fullscreen == true) {
videoEmbed += ' allowfullscreen="true"';
}
videoEmbed += ' allowscriptaccess="always"';
videoEmbed += ' width="'+options.width+'" height="'+options.height+'">';
videoEmbed += ' </embed>';
videoEmbed += '</object>';
return videoEmbed;
}
并在调用时传递您想要的选项,jTubeEmbed
例如:
$.jTubeEmbed(this.video, {
// your options here,
wmode: 'opaque'
});