本文介绍了如果Adobe Flash不可用,则提供替代图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么方法提供备用的GIF / PNG图像,以防用户没有安装和/或禁用Adobe Flash。
我发现了一些建议,如W3C的以下内容,它们通过JavaScript确定客户端上是否存在Adobe Flash:



老实说, 非JS 技巧。我正在考虑一些XHTML标签,相当于< noscript> 。 (如< noobject> ,如果对象(在我们的例子中为Flash)不能被显示/加载)。

需要这种分离的原因如下:
我工作的银行最好是以Flash格式显示其横幅。如果不可能,应该显示一个简单的图像。
在过去,它很可能以前面提到的方式解决。我们目前正在进行设计更新,这就是我偶然发现的这段代码,这让我怀疑它是否是最优雅和兼容的方式。



另一个想法让我感到震惊:实际上是否可以在JavaScript禁用的环境中加载Flash对象?

解决方案

 < object classid =clsid:D27CDB6E-AE6D-11cf-96B8-444553540000width =800height =600id =flashContent> 
< param name =movievalue =flash.swf/>
<! - [if!IE]> - >
< object type =application / x-shockwave-flashdata =flash.swfwidth =800height =600>
<! - <![endif] - >
<! - [if!IE]> - >
< / object>
<! - <![endif] - >
< / object>


Are there any ways providing an alternate GIF/PNG image, in case the user has no Adobe Flash installed and/or deactivated.I’ve found recommendations, like the following from W3C, which determine via JavaScript the existence of Adobe Flash on the client: W3C Providing alternative images

Honestly, I would prefer a non JS technique. I’m thinking of some XHTML tag, equivalent to <noscript>. (like <noobject> if the object (in our case Flash) can’t be displayed/loaded).

The reason for needing this separation is the following:The bank I’m working for will preferably display their banners in Flash format. In case it isn’t possible a simple image should be shown.In the past it was solved very likely in the way mentioned before. We’re currently working on a design refresh and that’s where I stumbled upon this piece of code which makes me wonder if it’s really the most elegant and compatible way of doing so.

Another idea that strikes me: Is it actually possible to load Flash-objects in a JavaScript disabled environment?

解决方案

Actually having flash installed but javascript turned off is a valid scenario. This should work across most browsers:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600" id="flashContent">
  <param name="movie" value="flash.swf" />
  <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="flash.swf" width="800" height="600">
  <!--<![endif]-->
      <img src="(...)" alt="Put your alternate content here" />
  <!--[if !IE]>-->
    </object>
  <!--<![endif]-->
</object>

这篇关于如果Adobe Flash不可用,则提供替代图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 08:10