开发者

Display alternate content when Flash is not installed with jquery.swfobject

开发者 https://www.devze.com 2023-01-02 15:18 出处:网络
How can I display alternate HTML with the jquery.swfobject plugin for browsers without Flash? I\'m unable to find any documentation or examples showing how to do this.

How can I display alternate HTML with the jquery.swfobject plugin for browsers without Flash? I'm unable to find any documentation or examples showing how to do this.

Here is a snippet of my code:

    <script type="text/javascript" language="Javascript" src="jquery.1.4.2.js"></script>
    <script type="text/javascript" language="Javascript" src="jquery.swfobject.1-0-9.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){

            $("#contentflash").flash({
                swf: "myswf.swf",               
                width: "100%",
                height: "100%",
                params: {
                    wmode: "opaque"
                }
            });

        });             
    </script>
</head>
<body>
<div id="contentfla开发者_StackOverflow中文版sh"></div>


Try placing some content in the

<div id="contentflash"></div>

Like

<div id="contentflash">No flash here man !</div>

This

$("#contentflash").flash 

replaces the id #contentflash being targeted.

Here is an example for completeness.


See this example. The content of the box is only replaced if flash is enabled. This doesn't remove the "go install flash" message, though.

0

精彩评论

暂无评论...
验证码 换一张
取 消