Flash backup image
so I have a pretty big flash file on my homepage, which raises a few issues abo开发者_如何学运维ut what to do if the user doesn't have flash player installed on his/her PC.
I would like to make sure that if the user has a old version of flash player, or doesn't have it at all, a backup image will display in place of the flash, how can I accomplish that?
Iss Javascript or jquery an option?
The best choice, IMHO, is to use swfobject
It will handle both issues:
- Users with Javascript disabled will get whatever alternate content you have for them
- Users with an older version of Flash installed will be prompted to download a newer version (expressInstall.swf)
Example Code:
<div id='myFlashMovie'>This text or image will be replaced if the user has the correct version of Flash</div>
<script type="text/javascript">
var flashvars = {};
var params = {'allowfullscreen':'true', 'allowscriptaccess':'always', 'wmode':'opaque', 'bgcolor':'#000'};
var attributes = {'name':'movie'};
swfobject.embedSWF("path/to/flash/movie.swf", "myFlashMovie", "640", "410", "9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>
Have a look at swfobject. It is the recommended method for embedding Flash into your webpage, and comes with all of the options you mentioned included.
Without JS and if no support:
<object.....><img src="noflash.gif" /></object>
精彩评论