www.webdeveloper.com
Results 1 to 2 of 2

Thread: smartphone detector issue

  1. #1
    Join Date
    Aug 2013
    Posts
    2

    Unhappy smartphone detector issue

    Hello,
    i'm new in the forum and this is the first time i write here.
    But now, here's my problem: i've a flash player animation for the men¨ of my site and this one it works properly, but not on mobile devices. So to resolve this issue i found a "program" in internet that change flash to javascript. It works properly this too. But here's the problem: i want when a user visualize my site from a pc starts the flash animation, otherwise the javascript animation. I used a a smartphone detector.js. So i use a script to see what device is opening my site, then decide if run the flash or the javascript animation, but this time something is going wrong becouse it doesn't work. If i open the file from the pc everything is ok, otherwise not the flash and neither the javascript run, so the final user see a page with no menu.
    I think it's a syntax problem but i'm not sure.
    I post here some code: this is the script to see what device is and run the javascript animation.

    HTML Code:
    <script>
          if(SmartphoneDetector.detectIPhone()){
    	  document.innerHTML = "<table width='768' align='center'><tr><td width='760' height='290'><div id='swiffycontainer' style='width: 766px; height: 287px'></div></td><tr>";
          var stage = new swiffy.Stage(document.getElementById('swiffycontainer'),
                                       swiffyobject);
          
          stage.start();
    	  }
    	  if(SmartphoneDetector.detectAndroid()){
    	  document.innerHTML = "<table width='768' align='center'><tr><td width='760' height='290'><div id='swiffycontainer' style='width: 766px; height: 287px'></div></td></tr>";
          var stage = new swiffy.Stage(document.getElementById('swiffycontainer'),
                                       swiffyobject);
          
          stage.start();
    	  }
    	  if(SmartphoneDetector.detectWindowsMobile()){
    	  document.innerHTML = "<table width='768' align='center'><tr><td width='760' height='290'><div id='swiffycontainer' style='width: 766px; height: 287px'></div></td></tr>";
          var stage = new swiffy.Stage(document.getElementById('swiffycontainer'),
                                       swiffyobject);
          
          stage.start();
    	  }
        </script>
    And this is the flash:
    HTML Code:
    <table width="768" align="center">
    	<tr>
    		<td width="760" height="290"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    				   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,24"
    				   width="766" height="287">
    			<param name="movie" value="flash/header_v8(3).swf?button=1"> 
    			<param name="quality" value="high">
    			<param name="menu" value="false">
    			<!--[if !IE]> <-->
    			<object data="flash/header_v8(3).swf?button=1"
    					width="766" height="287" type="application/x-shockwave-flash">
    			 <param name="quality" value="high">
    			 <param name="menu" value="false">
    			 <param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">
    			 Sembra che il dispositivo da cui stai visualizzando il sito non sia in grado di eseguire Adobe Flash Player.
    			 A breve sarÓ disponibile una versione Mobile del sito, nel frattempo ti consigliamo di visitare il nostro
    			 sito con un PC.<br/> Se invece desideri solo entrare nel tuo control panel clicca <a href="Controlpanel.html"><strong>QUI</strong></a>
    			</object>
    			<!--> <![endif]-->
    		   </object></td>
    	</tr>
    Sorry for my bad english, and waiting for anwers. Thanks to anyone wanna reply.

  2. #2
    Join Date
    Aug 2013
    Posts
    2
    up. Anyone?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles