Search code examples
htmlgoogle-swiffy

Flash to HTML fallback showing both animations on browsers such as Chrome


I used the "Malphurs interactive flash to HTML5" fallback recc in another post on this site. There is a problem with the conditional statements that cause both animations to appear on browsers that read both flash and html5. How can I improve the conditional statements? Thanks for any help-Andrea

<!-- InstanceBeginEditable name="head" -->
<script src= type="Scripts/swfobject_modified.js""text/javascript"></script>
 <!--[if !IE]>--><! > <script src="http://www.gstatic.com/swiffy/v4.0/runtime.js">           
 <!--[if !IE]>--><! >  <script src= "Scripts/swiffytest.js" type="text/javascript">           
<script src="https://www.gstatic.com/swiffy/v5.1/runtime.js"></script>
<script src="swiffytest.js" type="text/javascript"></script>
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<style type="text/css">
<!--

Solution

  • I am also going to implement a fallback for HTML5 very soon and I guess it is better to go for Modernizr which tests the support of HTML5 properties instead of doing browser specific conditional statements.


    http://modernizr.com/


    Modernizr.load() tutorial might be useful to you. For example you can check if the broswer supports canvas or csstransformation and decides whether it should give you the Flash object or the HTML5 things.