zoukankan      html  css  js  c++  java
  • JS拖动层(方法一)

    JS拖动层

     邬畏畏

    <script language="JavaScript" type="text/javascript">

        var drag_ = false;

        var temp2, temp1,x,y;

        function divdown(obj) {

            temp1 = obj.offsetLeft; temp2 = obj.offsetTop;

            x = window.event.clientX;

            y = window.event.clientY;

            drag_ = true;

        }

        function divmove(obj) {

            if (drag_) {

                obj.style.left = temp1 + window.event.clientX - x + "px";

                obj.style.top = temp2 + window.event.clientY - y + "px";

            }

        }

        function divup() {

            drag_ = false;

        }

    </script>

        <div id="edit" class="Edit">

    <div id="edit_bar" style="background-color:#bbbbbb;height:25px;text-align:right"

    onmousedown="divdown(edit)" onmousemove="divmove(edit)" onmouseup="divup()">

    <span onclick="隐藏层的脚本"><img src='img/closeIcon.gif' /></span>

    </div>

            <span align="center" style="font-size:12px;color:Blue">编辑名称</span><br>

            <input id="txtedit" type="text" value="" name="txtedit" style="120px" onmouseover="notmove()"/>

            <input type="button" value="修改保存" onclick="asyncSend(1)"/><input type="button" value="取消" onclick='HideLayer("edit")'/>

            <input id="Hidden_Table" type="hidden" runat="server" value="" /><!--"Trans_Area|T_Name|Tran_ID|recordID"--> 

        </div>

     

    截图:

     

  • 相关阅读:
    [GXOI/GZOI2019] 旧词
    [HDU6756] Finding a MEX
    [洛谷P5110] 块速递推
    [CF739C] Alyona and towers
    1349. 修理牛棚
    L2-028 秀恩爱分得快 (25 分)
    L2-009 抢红包 (25 分)
    L1-043 阅览室 (20 分)
    2020年天梯赛-模拟赛 L1-6 检查密码 (15 分)
    L1-046 整除光棍 (20 分)
  • 原文地址:https://www.cnblogs.com/wsoft/p/2104530.html
Copyright © 2011-2022 走看看