div + css中引用flash的方法:SWFObject

      SWFObject是一个用于在HTML中方面插入Adobe Flash媒体资源(*.swf文件)的独立、敏捷的JavaScript模块。该模块中的JavaScript脚本能够自动检测PC、Mac机器上各种 主流浏览器对Flash插件的支持情况。它使得插入Flash媒体资源尽量简捷、安全。而且它是非常符合搜索引擎优化的原则的。此外,它能够避免您的 HTML、XHTML中出现object、embed等非标准标签,从而符合更加标准。

  (即:通过text/html应答页面, 而非application/xhtml+xml)

 SwfObject中文翻译(很详细的):http://www.awflasher.com/flash/articles/swfobj.htm

方法:1、下载swfobject.js

       2、 html实例:

ContractedBlock.gif ExpandedBlockStart.gif Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SWFObject embed by Geoff Stearns (basic) @ deconcept</title>
<!-- SWFObject embed by Geoff Stearns geoff@deconcept.com http://blog.deconcept.com/swfobject/ -->
<script type="text/javascript" src="swfobject.js"></script>
<style type="text/css">
    
ExpandedBlockStart.gifContractedBlock.gif    body 
{
        background
-color: #eeeeee;
        font: .8em
/1.3em verdana,arial,helvetica,sans-serif;
    }


ExpandedBlockStart.gifContractedBlock.gif    #info 
{
        width: 300px;
        overflow: auto;
    }


ExpandedBlockStart.gifContractedBlock.gif    #flashcontent 
{
        border: solid 1px #
000;
        width: 300px;
        height: 300px;
        
float: left;
        margin: 15px 20px;
    }


</style>
</head>
<body>

    
<div id="flashcontent">
        
<strong>You need to upgrade your Flash Player</strong>
        This 
is replaced by the Flash content. 
        Place your alternate content here and users without the Flash plugin or with 
        Javascript turned off will see 
this. Content here allows you to leave out <code>noscript</code> 
        tags. Include a link to 
<a href="swfobject.html?detectflash=false">bypass the detection</a> if you wish.
    
</div>

    
<script type="text/javascript">
        
// <![CDATA[
        
        var so 
= new SWFObject("so_tester.swf""sotester""300""300""9""#FF6600");
        so.addVariable(
"flashVarText""this is passed in via FlashVars for example only"); // this line is optional, but this example uses the variable and displays this text inside the flash movie
        so.write("flashcontent");
        
        
// ]]>
    </script>

    
<div id="info">
        
<p>
            This Flash movie was embedded 
using the <a href="http://blog.deconcept.com/swfobject/">SWFObject</a> embed method by <a href="http://blog.deconcept.com/">Geoff Stearns</a>.
        
</p>
        
<p>Other sample embeds:</p>
        
<ul>
            
<li>Basic Flash Embed with alternate content</li>
            
<li><a href="fullpage.html">Full page Flash embed</a></li>
            
<li><a href="expressinstall.html">Basic Flash Embed with Express Install allowed</a></li>
        
</ul>
        
<p>You can also <a href="flashversion.html">view your installed Flash version</a>.</p>
        
<p>
            
<a href="view-source:http://blog.deconcept.com/swfobject/swfobject.html">View source</a> (in mozilla, firefox) | <a href="swfobject_source.js">View Javascript</a>.
        
</p>
        
<p>
            
<a href="http://blog.deconcept.com/swfobject/swfobject1-4.zip">Download Source</a>.
        
</p>
    
</div>
    
    
<p style="clear: both;margin-left: 20px"><a href="http://validator.w3.org/check?uri=referer">Validate XHTML</a> and <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></p>
</body>
</html>

 

转载于:https://www.cnblogs.com/zqy801105/archive/2009/03/10/1407776.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值