簡體   English   中英

swfobject:如何將 html 標題屬性添加到 object(閃存)

[英]swfobject : how to add html title attribute to object (flash)

我使用 swfobject.js 文件將 flash 內容嵌入到我的網站上。 如何將 html 標題屬性添加到通過它嵌入的閃存對象中。

因為,一些瀏覽器確實在鼠標懸停或狀態、工具提示或瀏覽器狀態中顯示 object 的標題。 [例如。 IE6 和 Opera ]

請幫忙

安妮塔

您可以將變量傳遞給 Flash 文件,並以跨平台的方式啟用工具提示。

so.addVariable("var", "value"); 

從 DOM 中獲取值:

document.title

所以:

var mytitle;
var = document.title;
so.addVariable("mytitle", mytitle); 

使用SWFObject 2.2

var attributes = {
   title: document.title
};
swfobject.embedSWF("mymovie.swf", //URL for SWF file
                   "mytargetdiv", //Target element
                   "550",         //SWF width
                   "400",         //SWF height
                   "9",           //Minimum required version of Flash Player
                   false,         //Path to ExpressInstall SWF (if desired)
                   false,         //Flashvars (if desired)
                   false,         //Parameters (if desired)
                   attributes);   //Attributes (if desired)

這假定您的<title>元素位於頁面標記中的<script>元素之前。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM