Fancybox视频集锦,一无所有 [英] Fancybox video highlight with nothing in rails
本文介绍了Fancybox视频集锦,一无所有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在fancybox中播放视频.
I need to play videos in fancybox.
根据此解决方案
我开始工作
我的href标签看起来像
My a href tag looks like
<a class="fancybox" href="/uploads/ckeditor/attachments/55/myvideo.mp4">
<img class="check" height="120" weight="160" src="/uploads/ckeditor/attachments/55/myvideo.jpg" alt="Myvideo">
</a>
和我的jQuery
$(document).ready(function () {
$("a.fancybox").fancybox({
fitToView: false,
content: '<span></span>',
scrolling: 'no',
afterLoad: function (){
this.content = "<embed src='/jwplayer.swf?file=" + this.href + "&autostart=true&wmode=opaque' type='application/mp4' width='140' height='180'></embed>";
}
});
});
当在该图像上单击时,fancybox却无响应.控制台和浏览器没有错误
While ckick on that image it fancybox responds with nothing. No error in console and browser
我的fancybox内容与下一行没有区别
my fancybox content doesn't have apart from the following line
<div id="fancybox-content" style="border-width: 10px; width: 0px; height: auto;">
请帮助我. 提前非常感谢.
please help me. Thanks a lot in advance.
推荐答案
这终于对我有用.
$(document).ready(function() {
$(".fancybox").fancybox({
type: "iframe",
width : 380, // or whatever
height: 280
}).trigger("click");
});
这篇关于Fancybox视频集锦,一无所有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文