Advertisement
Bruno

[PHP] Drag and Drop - INDEX.PHP

Dec 26th, 2012
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.67 KB | None | 0 0
  1. <!--
  2.     @Bruno Pereira (brunopereiraa-@hotmail.com)
  3.     @Função: Pegar e soltar ícones onde desejar.
  4.     @http://ips-team.tk/forum/
  5.     @http://projetosbrunopereira.com.br/
  6. -->
  7.  
  8. <script type="text/javascript" src="js/jquery.js"></script>
  9. <script type="text/javascript" src="js/jquery-ui.js"></script>
  10.  
  11. <html>
  12.     <head>
  13.         <style>
  14.             div#menu ul li{margin-left: -40px; -webkit-box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.5); padding:2px; width:150px; #88c9eb; background:-webkit-gradient(linear, left top, left bottom, color-stop(10%,#96dafd), color-stop(80%,#75b4d5)); list-style-type:none; margin-bottom:3px; border-radius: 7px 7px 7px 7px;  color:#fff; cursor:move; font:12px "Verdana", Arial, Helvetica, sans-serif;}
  15.         </style>
  16.         <script type="text/javascript" src="js/jquery.js"></script>
  17.         <script type="text/javascript" src="js/jquery-ui.js"></script>
  18.         <script type="text/javascript">
  19.             $(document).ready(function() {
  20.                 $(function() {
  21.                     $("#menu ul").sortable({
  22.                         opacity: 0.5,
  23.                         cursor: 'move',
  24.                         update: function() {
  25.                             var order = $(this).sortable("serialize")+'&acao=atualizar';
  26.                             $.post("system/atualizar.php", order, function(retorno){
  27.                                 $("#array").html(retorno);
  28.                             });
  29.                         }
  30.                     });
  31.                 });
  32.             });
  33.         </script>
  34.     </head>
  35.     <?php include_once "system/db.php"; ?>
  36.     <body bgcolor="#ccc">
  37.             <div id="menu">
  38.                 <ul>
  39.                     <?php
  40.                         $select = mysql_query("SELECT * FROM `itens` ORDER BY ordem");
  41.                         while($item = mysql_fetch_object($select)) {
  42.                     ?>
  43.                     <li id="widgetArray_<?php echo $item->id;?>"><?php include 'widgets/'.$item->texto.'.php';?></li>
  44.                     <?php } ?>
  45.                 </ul>
  46.             </div><!-- menu -->
  47.     </body>
  48. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement