|
-
How do I show a static pic if the user doesn't have flash installed?
Please check out this website first for what I'm going for:
http://www.awakenedmillionairesecrets.com
The header is a graphic of a guy's head and a car.
I want to design the same kind of page but my header graphic will have a cartoon head instead of that guy's head and it will animate.
Now If the user does not have flash installed I would like to have a static header image appear, like a .jpeg or a .gif, instead of the .swf header.
How can I do this?
Thanks
-
Senior Member
Well there are a few different ways to achieve this, you can use Javascript or with plain old HTML.
In HTML it's as simple as putting the image it in between the <object> tags:
Code:
<object width="550" height="400"><img src="image.png"/></object>
The only problem with that is it doesn't work on all browsers. Using Javascript allows the HTML code to be dynamically generated depending on your browser and flash version. This, of course, won't work if the user has javascript off.
-
Senior Member
I am adding an update to this thread since I was looking for an answer as well.
If you are using swfobject, the code below will display Flash if the plugin is detected, and a static image if it is not. This is ideal for iPhone users, who would normally just see a blank space where a Flash file is in use. Here is the code:
PHP Code:
<script type="text/javascript" src="swfobject.js"></script> <div id="flashcontent"> <img src="images/alternate_image.jpg" width="500" height="100"> </div> <script type="text/javascript"> var so = new SWFObject("filename.swf", "name", "500", "100", "8"); so.addParam("quality", "high"); so.write("flashcontent"); </script>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|