Results 1 to 2 of 2

Thread: Alternate image (for IPad) attempts don't work in IE8 or IE9

  1. #1
    Join Date
    Dec 2008
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Alternate image (for IPad) attempts don't work in IE8 or IE9

    Hello - I have made 2 attempts to show alternate image content for IPad (no Flash) - one using an animated gif, and one using swiffy. I want to have desktops still show the Flash, but Ipads show the alternate animations. Both of these solutions worked great! Except for one problem -- the Flash showed as usual in Chrome, Safari and FFox, but guess who now doesn't show the Flash. IE8 & 9.

    I have 2 divs, one for the .gif, one for the Flash -- I can paste the javascript below, can anyone tell me if there is something I can add to it to force the IE browsers to still show the Flash?

    Code:
    <script language="javascript">
    if ((navigator.userAgent.match(/iPad/i) != null) || (navigator.userAgent.match(/iPhone/i) != null) || (navigator.userAgent.match(/iPod/i) != null)) { document.getElementById("altimage").style.display = "block"; document.getElementById("origflash").style.display = "none"; }
    </script>
    The first div is <div id="altimage" style="display:none">
    Second is <div id="origflash" style="display:block">


    For the Swiffy html5 attempt:

    The only difference is the first div pulls the Swiffy html into an iframe:

    HTML Code:
            <div id="althtml5" style="display:none">
          <iframe vspace="0" hspace="0" width="630" height="220" src="http://beta.patternworks.com/test/pw1ST.swf.aspx" scrolling="no"
    style="overflow:visible">
    </iframe></div>
    The javascript is the same, but references the first div differently
    Code:
    <script language="javascript">
    if ((navigator.userAgent.match(/iPad/i) != null) || (navigator.userAgent.match(/iPhone/i) != null) || (navigator.userAgent.match(/iPod/i) != null)) { document.getElementById("althtml5").style.display = "block"; document.getElementById("origflash").style.display = "none"; }
    </script>
    -- need a resolution to show the Flash on the desktop IE browsers. Thank you in advance, I really, really hope someone can help me with one or the other (or both! : ) of these options.
    Last edited by keyboard; 10-29-2012 at 08:56 PM. Reason: Format: Code Tags [code][/code], Icode Tags [icode][/icode], Html Tags [html][/html]

  2. #2
    Join Date
    Jul 2008
    Posts
    128
    Thanks
    0
    Thanked 17 Times in 16 Posts

    Default

    Quote Originally Posted by keltoid View Post
    Code:
    <script language="javascript">
    if ((navigator.userAgent.match(/iPad/i) != null) || (navigator.userAgent.match(/iPhone/i) != null) || (navigator.userAgent.match(/iPod/i) != null)) { document.getElementById("altimage").style.display = "block"; document.getElementById("origflash").style.display = "none"; }
    </script>
    That code must be positioned below the elements to which it refers. Is it?

Similar Threads

  1. Does any lighbox style of script work on iPhone/iPad and Android phones?
    By mlegg in forum Looking for such a script or service
    Replies: 3
    Last Post: 08-30-2012, 11:21 PM
  2. Replies: 0
    Last Post: 06-29-2011, 03:37 PM
  3. iPad issue with CSS Image Gallery hover image enlarge
    By walkoffhomerun in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 06-26-2011, 07:55 PM
  4. My first attempts at php
    By lmellor in forum PHP
    Replies: 2
    Last Post: 11-30-2008, 05:55 PM
  5. Replies: 10
    Last Post: 05-22-2008, 09:48 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •