我很難將新的fancybox(V.2.0.4 g81c12d7)與新的iframe vimeo嵌入代碼集成。 有人有解決方案嗎?fancybox 2.0.4和Vimeo
4
A
回答
11
是的,最簡單的方法是使用新的vimeo的「universal player」嵌入您的視頻。
請按照下列步驟操作:
A)。從視頻頁面中選擇一個視頻,然後選擇圖標「embed
」(通過視頻)。
B)。獲取iframe
代碼,如下所示:
<iframe src="http://player.vimeo.com/video/34792993?title=0&byline=0&portrait=0" width="400" height="225" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
C)。提取src
屬性的內容,並將其設爲您的鏈接一樣的href
:
<a class="vimeo" href="http://player.vimeo.com/video/34792993?title=0&byline=0&portrait=0">open vimeo in fancybox</a>
d)。那麼你的fancybox(版本2.x)自定義腳本應該是這樣的:
<script type="text/javascript">
$(document).ready(function() {
$(".vimeo").fancybox({
width: 400,
height: 225,
type: 'iframe',
fitToView : false
});
});
</script>
注意我從iframe
代碼width
和height
。
UPDATE(2013年6月25日):另一種更簡單便捷的方式觀看fancybox中的vimeo視頻(v2.1.5與今天一樣)正在使用fancybox媒體助手。檢查https://stackoverflow.com/a/17202629/1055987作進一步參考。
0
因爲我們只能調整iframe的視頻,如果它是在我們自己的領域,我通過複製
http://cache.vevo.com/m/html/embed.html
所有HTML內容http://localhost/vevo.html
解決了這個問題。然後,改變了CSS:
#videoPlayerSWF {
width: 100%;
height:100%;
}
現在,我使用調用的fancybox網址:
http://localhost/vevo-embed.html?video=USUV71402745
具有相同的HTML,CSS和JavaScript爲:
http://cache.vevo.com/m/html/embed.html
相關問題
- 1. FancyBox與Vimeo不工作
- 2. Fancybox 2.0.4 fancybox功能已從jquery插件中刪除
- 3. Vimeo vid in fancybox - 只玩第一次
- 4. fancyBox 2 Vimeo嵌入不工作
- 5. 將fancybox調整爲vimeo視頻大小
- 6. 使用VIMEO視頻和一個的fancybox彈出
- 7. HTML5視頻不會在iPhone上玩,雖然FancyBox 2.0.4
- 8. highstock 2.0.4對IE和Firefox
- 9. silex 2.0.4和symfony窗體3.2
- 10. DreamFactory 2.0.4
- 11. PhoneGap,IOs和Vimeo
- 12. Vimeo和AnythingSlider
- 13. 視頻不玩嵌入式vimeo視頻jquery fancybox?
- 14. 在fancybox中顯示vimeo,在IE中遇到問題
- 15. Vimeo的問題與jQuery的fancybox +無限旋轉木馬
- 16. Fancybox Vimeo在點擊上顯示白色屏幕
- 17. Heroku和Vimeo衝突?
- 18. iReport 2.0.4 - UnsupportedOperationException
- 19. Kobold2d 2.0.4警告
- 20. CakePHP的2.0.4
- 21. Mysqlbackup錯誤2.0.4
- 22. New Relic Monitoring for Play框架2.0.4和2.1
- 23. Telerik和jQuery:RadGrid和Fancybox
- 24. Cakephp 2.0.4 ACL錯誤
- 25. fancybox和worldpay
- 26. FlexSlider和Fancybox
- 27. Phonegap,Youtube和Fancybox
- 28. jCarousel和Fancybox
- 29. fancybox和鏈接
- 30. Fancybox和Transparency
我是有這個同樣的問題與Shadowbox庫(https://github.com/mjackson/shadowbox),這個答案也解決了我的問題(使用iframe URL作爲鏈接)。 –