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

拈花ヽ惹草 提交于 2019-12-23 03:52:06

问题


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="contentflash"></div>

回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/2962286/display-alternate-content-when-flash-is-not-installed-with-jquery-swfobject

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!