2014-02-17 2 views
0

$about$about[$i]['about_bg'] = image name$about[$i]['sort']= sort no 지금 내가 드래그를 사용하여 이미지를 chnage 및 기능을 드롭 할 수있는 배열에 포함 된, 데이타베이스를 업데이트 할 수 있지만 내가 업데이트하려면 어떻게 또한 데이터베이스끌어 이미지를 삭제하고 또한

를 업데이트 할 데이터베이스 아약스 요청을 사용하여?

<div style="margin-top: 276px;margin-left: 465px;"> 
    <table border="1"> 
     <tr > 
      <td colspan="<?=count($about)?>" >drag and drop to change the image<td> 
     </tr> 
     <tr> 
<?php  
      for ($i=0; $i<count($about) ; $i++) { 
       echo "<td>".$about[$i]['sort']."</td>"; 
}?> 
     </tr> 
     <tr class="sortable" > 
<?php  
      for ($ii=1,$i=0; $i<count($about) ; $i++) { 
       echo "<td><img src='../img/cms/".$about[$i]['about_bg']."' title='Drag and drop the image ' height='100' width='100'></td>"; 
} ?> 
     </tr> 
     </table> 
     </div> 

<script> 
    $(function() { 
    $(".sortable").sortable(); 
    $(".sortable").disableSelection(); 
    }); 
    </script> 

답변

0
$('.sortable').sortable({ 
    change: function() { 
    $.ajax({ 
     //do your call 
    }) 
    } 
}); 
+0

하지만 내가 어떻게 변경되는 이미지입니다 알 수 있습니까? –

+0

하지만 어떤 이미지가 변경되는지 어떻게 알 수 있습니까? –

+0

http://api.jqueryui.com/sortable/ 심각하게 ... – Soundz

관련 문제