zoukankan      html  css  js  c++  java
  • ajax+php鼠标拖动层至任意位置并实时保存

    注意,删除功能和修改没有,不过这个很简单,也不影响本例程的演示

    http://www.corange.cn//uploadfiles/1215-5_39251.jpg

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    </head>



    <STYLE>

    /*****定义鼠标样式******/
    .btnpic
    {
    CURSOR: pointer
    }
    .gbPicDiv
    {
    BACKGROUND-IMAGE: url(329_205754.gif); WIDTH: 168px; CURSOR: move; HEIGHT: 131px;
    }
    /******定义鼠标样式完毕*****/

    .say /**标题**/
    {
    font-size:12px;
    color:#FF0000;
    }

    .content /***鼠标滑出的时候内容的class**/
    {
    font-size:12px;
    color:#0099FF;
    }
    .contenth /***鼠标滑过的时候内容的class****/
    {
    color:#9933FF;
    font-size:12px;
    }
    .del /***管理 删除 的 class***/
    {
    font-size:12px;
    color:#333399;
    text-decoration:none;
    }
    .del:hover /***管理 删除 经过时候的 class***/
    {
    font-size:16px;
    color:#333399;
    text-decoration:none;
    }


    </STYLE>


    <script type="text/javascript" src="1.js"></script>


    <body>




    <?php

    require('sql.php');

    //--------------要执行的SQL语句
    $sql="select * from `ceng` order by `zzhou` asc";


    //--------------进行资料库的查询
    $result=mysql_query($sql,$cn);
    $i=1;
    while( $row=mysql_fetch_row($result) )
    {
    //print_r($row);
    ?>
    <DIV onmouseup=upDrag('<?=$row[0]?>') onmousedown=initDrag(event)
    style="Z-INDEX: <?=$i?>; POSITION: absolute;left: <?=$row[2]?>px; top: <?=$row[3]?>px;">
    <DIV class=gbPicDiv id="<?=$row[0]?>" align="center">
    <br />
    <table width="140" align="center">
    <tr>
    <td><span class="say"><?=$row[4]?>说到</span></td>
    </tr>
    <tr>
    <td><div id="<?=$row[0]?>a" class="content" align="left" onmouseout="return out('<?=$row[0]?>a')" onmouseover="return over('<?=$row[0]?>a')">&nbsp;&nbsp;&nbsp;&nbsp;<?=$row[1]?></div></td>
    </tr>
    </table>
    <div align="center"><a href="tian.php" class="del">新增</a> <a href="#" class="del" onclick="return del('修改');">修改</a> <a href="#" class="del" onclick="return del('删除');">删除</a></div>
    </DIV>
    </DIV>

    <?php
    $i++;
    }

    ?>

    <?php
    $sql1="select max(zzhou) from ceng"; //求出层的最大值
    $result1=mysql_query($sql1);
    $row1=mysql_fetch_row($result1);

    ?>

    <input type="hidden" name="count" value="<?=$row1[0]+1?>" id="count"/>


    </BODY>
    </HTML>
    例子下载,带数据库,注意数据库名称
    http://www.corange.cn//uploadfiles/ajax_php_drag_31530.rar
  • 相关阅读:
    check datagurad scripts using python
    nagios check_oracle plugin (add check temp tablespace)
    monitor tomcat sctips
    ATM 练习
    socket 练习 ftp
    socket 练习 sendcommand
    带你走进虚拟化世界之kvm(转载)
    luogu2732商店购物
    uva1625颜色的长度
    luogu3147 [USACO16OPEN]262144
  • 原文地址:https://www.cnblogs.com/zerogo/p/1550223.html
Copyright © 2011-2022 走看看