2013-02-21 51 views
1

如何能夠將Flash播放器到網頁使用自定義網址。這樣做與Iframes,而不是在HTML中使用對象標籤。我需要使用JavaScript來實現這一目標?嵌入安裝Flashplayer中的iFrame

回答

0

一種選擇是使用jQueryTools flashembed(),這使您可以嵌入Flash對象到一個div ...這可能是你一個很好的起點。

$(document).ready(function() { 
    //jquery call to embed flash object, 
    flashembed("#frameID", {src: "the-SWF-URL",wmode:"opaque"}); 
    //set width and height - ffox fix 
    $('#frameID').css({'width':'564px','height':'160px','z-index':'-1'}); 
}); 

獲取更多信息和選項 - http://jquerytools.org/documentation/toolbox/flashembed.html

+1

如果您使用jQuery的,然後其他的東西是,但除此之外,還有其他的JavaScript庫更適合的任務,即SWFObject的,那就是或多或少嵌入SWF內容的事實上的標準。 http://code.google.com/p/swfobject/ – 2013-02-21 09:41:11

2

我不明白爲什麼你不能簡單地使用像src屬性:

<iframe width="100px" height="100px" src="youSwfFile.swf"></iframe> 
+0

Flash播放器會在iframe的頂部 – alex 2013-02-21 04:40:12