Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/250.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何按字母顺序单击?_Php_Svg_Alphabetical - Fatal编程技术网

Php 如何按字母顺序单击?

Php 如何按字母顺序单击?,php,svg,alphabetical,Php,Svg,Alphabetical,我是新的编码,所以我想问我如何才能使下面的代码,鱼只能按字母顺序点击,这意味着只有鱼“A”可以先点击,而点击其他鱼不是“A”,它不能在点击后消失?有办法吗 <?xml version='1.0' standalone='no'?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width='100%

我是新的编码,所以我想问我如何才能使下面的代码,鱼只能按字母顺序点击,这意味着只有鱼“A”可以先点击,而点击其他鱼不是“A”,它不能在点击后消失?有办法吗

<?xml version='1.0' standalone='no'?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg width='100%' height='100%' xmlns='http://www.w3.org/2000/svg' onload='Init(evt)'>
   <title>Fish Game</title>
   <script type='text/ecmascript'><![CDATA[
      var SVGDocument = null;
      var SVGRoot = null;

      function Init(evt)
      {
         SVGDocument = evt.target.ownerDocument;
         SVGRoot = SVGDocument.documentElement;
      }

      function ToggleOpacity(evt, targetId)
      {
         var newTarget = evt.target;

         if (targetId)
         {
            newTarget = SVGDocument.getElementById(targetId);
         }

         var newValue = newTarget.getAttributeNS(null, 'opacity')

         if ('0' != newValue)
         {
            newValue = '0';
         }
         else
         {
            newValue = '1';
         }

         newTarget.setAttributeNS(null, 'opacity', newValue);

         if (targetId)
         {
            SVGDocument.getElementById(targetId + 'Exception').setAttributeNS(null, 'opacity', '1');
         }
      }
   ]]></script>

 <?php 
    mysql_connect("localhost", "root", "") or die(mysql_error()); 
    mysql_select_db("db") or die(mysql_error()); 
    static $data;
    $data = mysql_query("SELECT * FROM alphabet;") 
    or die(mysql_error()); 

    while($info = mysql_fetch_array( $data )) { 
 ?> 
 <text x="20" y="20"  style="font-family:Times,serif;fill:#B40404;font-size:20px">please find the letter:</text>

//fish body
<g id='<?php print $info['ID']; ?>' onclick='ToggleOpacity(evt, "<?php print $info['ID']; ?>")'>
 <circle cx="<?php print $info['body_cx']; ?>"cy="<?php print $info['body_cy']; ?>" r="<?php print $info['body_r']; ?>" stroke="black" stroke-width="1" fill="<?php print $info['body_fill']; ?>" />

//tail
<path d="<?php print $info['tail']; ?>" fill="<?php print $info['tail_fill']; ?>" stroke="<?php print $info['tail_stroke']; ?>" stroke-width="1" />

//eye
<circle cx="<?php print $info['eye_cx']; ?>" cy="<?php print $info['eye_cy']; ?>" r="<?php print $info['eye_r']; ?>" stroke="black" stroke-width="1" fill="<?php print $info['eye_fill' ];?>" />
<circle cx="<?php print $info['pupil_cx']; ?>" cy="<?php print $info['pupil_cy']; ?>" r="<?php print $info['pupil_r']; ?>" stroke="black" stroke-width="1  " />

//'A'
    <text x="<?php print $info['al_x']; ?>" y="<?php print $info['al_y']; ?>" style="font-family:Times,serif;fill:#B40404;font-size:<?php print $info['size']; ?>"><?php print $info['Alphabet']; ?></text>

    <animateMotion
        from="<?php print $info['from']; ?>" to="<?php print $info['to']; ?>"
        dur="<?php print $info['duration']; ?>"   repeatCount="indefinite" />
   </g>
  <?php   
    }  
 ?>
</svg>

鱼游戏
请查收信件:
//鱼体

我们没有给出答案。你必须先付出努力,我们会一路帮助你的。
SELECT * 
FROM  `alphabet` 
ORDER BY  `Alphabet` ASC