Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.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 jQuery多级可排序列表IE问题_Php_Jquery_Internet Explorer - Fatal编程技术网

Php jQuery多级可排序列表IE问题

Php jQuery多级可排序列表IE问题,php,jquery,internet-explorer,Php,Jquery,Internet Explorer,下午好 今天,我像往常一样,在使用jQuery库和Ajax时,被IE搞晕了 那么我的问题是什么呢,我们来看看我的现场演示: 尝试在FF/Chrome中对项目进行排序,然后在IE中进行测试,因为比尔·盖茨,我们都将使用facepalm 可能的解释:即抓住整个ul,而不是ul内部的ul。。有解决办法吗 index.php的代码 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/

下午好

今天,我像往常一样,在使用jQuery库和Ajax时,被IE搞晕了

那么我的问题是什么呢,我们来看看我的现场演示:

尝试在FF/Chrome中对项目进行排序,然后在IE中进行测试,因为比尔·盖茨,我们都将使用facepalm


可能的解释:即抓住整个ul,而不是ul内部的ul。。有解决办法吗

index.php的代码

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
    <script type="text/javascript">
      // When the document is ready set up our sortable with it's inherant function(s)
      $(document).ready(function() {
    <?php
    include_once("../ond/inc/php/connect.php");
    $i = 0;
    $result = mysql_query("SELECT * FROM paginas WHERE type='0' ORDER BY id ASC");      
    while($row = mysql_fetch_array($result))
    {       
        $i++;
        $result2 = mysql_query("SELECT * FROM paginas WHERE type=".$row{"id"}." ORDER BY id ASC LIMIT 1");   
        while($row2 = mysql_fetch_array($result2))
        {   

            echo '  $("#submenu_list'.$i.'").sortable({
                    handle : \'.handle\',
                    update : function () {
                    var order = $(\'#submenu_list'.$i.'\').sortable(\'serialize\');
                    $("#info").load("process-sortable.php?"+order);
                        }
                    });
                ';
        }                   
    }       
    ?>      
        $("#menu_list").sortable({
                handle : '.handle',
                update : function () {
                var order = $('#menu_list').sortable('serialize');
                $("#info").load("process-sortable.php?"+order);
            }
        });
    });
    </script>
    </head>
    <body>
    <?php       


            $result = mysql_query("SELECT * FROM paginas_test WHERE type='0' ORDER BY position ASC");    
                echo '<table cellspacing="2" cellpadding="2">';
                echo '  <tr>';
                echo '      <th colspan="2" scope="col"><img src="../ond/inc/afb/report.png" />Volgordebepaling</th>';
                echo '  </tr>';
                echo '</table>';
                echo '<ul id="menu_list">';
                $i = 0;
                    while ($row = mysql_fetch_array($result))
                    {   
                        $i++;
                        echo '<li style="list-style:none;" id="listItem_'.$row{"id"}.'">';
                        echo ' <img src="../testajax/arrow.png" alt="move" width="16" height="16" class="handle" /> '.$row{"titel"}.'<br />';
                        #mysql_query("SELECT * FROM paginas WHERE type='0' ORDER BY id ASC");                   
                        $result2 = mysql_query("SELECT * FROM paginas_test WHERE type=".$row{"id"}." ORDER BY position ASC");    
                        echo '<ul id="submenu_list'.$i.'">';
                            while($row2 = mysql_fetch_array($result2))
                            {       

                                    echo '<li style="list-style:none;margin-left:15px;" id="sublistItem_'.$row2{"id"}.'">';
                                        echo '<img src="../testajax/arrow.png" alt="move" width="16" height="16" class="handle" /> '.$row2{"titel"}.'<br />';
                                    echo '</li>';
                            }
                        echo '</ul></li>';
                    }
                echo '</ul>';
                echo '<div id="info"></div>';
    ?>
    </body>
    </html>

//文档准备好后,使用其内部函数设置我们的排序表
$(文档).ready(函数(){

检查此项:

“可能的解释:IE抓住整个ul而不是ul内部的ul。”这似乎正是发生的情况。不仅仅是IE:FF4在几次移动到之后会这样做。“IE抓住整个ul而不是ul内部的ul。有解决方案吗?”Chrome给了我与IE8相同的行为……你说的是哪个版本的IE?我现在支持IE7+8。@Patrica自己使用FF4似乎没有问题。
<?php
include("../ond/inc/php/connect.php");

if(isset($_GET['listItem']))
{
foreach ($_GET['listItem'] as $position => $item)
{
    $sql = "UPDATE `paginas_test` SET `position` = $position WHERE `id` = $item";
    mysql_query($sql);
}
}

if(isset($_GET['sublistItem']))
{
foreach ($_GET['sublistItem'] as $position2 => $item2)
{
    $sql = "UPDATE `paginas_test` SET `position` = $position2 WHERE `id` = $item2";
    mysql_query($sql);
}
}
print_r ($sql);
?>