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>

     

    截图:

     

  • 相关阅读:
    java实现取球类的博弈问题
    下载安装eclipse
    配置jdk环境变量
    蓝桥杯三羊献瑞题目
    java用Kruskal实现最小生成树
    java创建自定义类的数组
    java暴力递归回溯算法
    易理解java代码8皇后问题
    Listview 点击获取view
    java android布局里的控件值 反射绑定给实体类,实体类绑定给控件,表单提交绑定很有用
  • 原文地址:https://www.cnblogs.com/wsoft/p/2104530.html
Copyright © 2011-2022 走看看