惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
Help Net Security
Help Net Security
P
Privacy International News Feed
T
Threat Research - Cisco Blogs
C
Cisco Blogs
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
L
LINUX DO - 热门话题
Security Latest
Security Latest
A
Arctic Wolf
G
GRAHAM CLULEY
月光博客
月光博客
S
Securelist
D
Docker
J
Java Code Geeks
T
Troy Hunt's Blog
T
Tenable Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
SecWiki News
SecWiki News
S
Security @ Cisco Blogs
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LINUX DO - 最新话题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
aimingoo的专栏
aimingoo的专栏
博客园 - 【当耐特】
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 三生石上(FineUI控件)
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
Netflix TechBlog - Medium
Vercel News
Vercel News
Forbes - Security
Forbes - Security
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
B
Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
S
Secure Thoughts
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Check Point Blog
云风的 BLOG
云风的 BLOG
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Blog of Author Tim Ferriss
L
Lohrmann on Cybersecurity
F
Full Disclosure
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed

博客园 - KenBlove

错误代码:0x800706BE 解决方法 泛微OA服务器更改IP地址后EMobile出现“调用远端服务器接口时发生错误(122)”的提示 HTTP 错误 404 - 文件或目录未找到 HTTP 错误 401.2 - 未经授权:访问由于服务器配置被拒绝。 优雅还不够,简洁才高效!——用NValidator一句话搞定客户端检测 MyXls初级教程 一个仿PetShop的通用DBHelper类 纯CSS实现底部固定漂浮导航 Access和SQL server开启表间关系,并实现更新或删除母表数据自动更新或删除子表数据 来自微软关于异常处理的17条军规 SQL Server Profiler过滤本机信息的办法 "The state information is invalid for this page and might be corrupted"错误的一个解决办法 SQL回滚Transaction来调试SQL语句 SQL找出和删除一个表的重复记录 SQL常用判断检测语句 SQL把ID相同的记录合并成同一条记录 从丑陋到优雅,让代码越变越美续集之服务器端数据校验 关于FireFox记住密码后出现的bug 关于Iframe在IE6下不显示的bug 从丑陋到优雅,让代码越变越美(客户端检测方法思考)
一个简单的拖动层(兼容IE,FF)
KenBlove · 2009-06-05 · via 博客园 - KenBlove

Code
<!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>
    
<title>拖动层</title>
    
<style type="text/css">
    .main
    
{
        position
: absolute; 
        background-color
: #fff;
        top
: 100px; 
        left
: 100px; 
        z-index
: 101; 
        border
: solid 1px #ccc;
    
}
    .titlebar
    
{
        background-color
: #ccc; 
        cursor
: move; 
        height
: 20px; 
        color
: #fff;
        font-size
: 13px; 
        padding-top
: 5px; 
        padding-left
: 10px;
    
}
    
</style>
</head>
<body>
    
<div id="main" class="main" style="width: 500px; height: 350px;">
        
<div id="titlebar" class="titlebar">
            拖动层
        
</div>
        
<div id="Div1" class="main" style="width: 200px; height: 50px;">
            
<div id="Div2" class="titlebar">
                拖动层2
            
</div>
        
</div>
    
</div><script type="text/javascript">
        
new drag("main""titlebar");
        
new drag("Div1""Div2");function drag(main, titlebar) {
            
var obj = document.getElementById(main);
            
var title = document.getElementById(titlebar);
            
if(obj && title)
            {            
                
var posX;
                
var posY;
                
var offset = 10;
                
var mousemove = function(evt) {
                    
if (evt == null) evt = window.event;
                    
var left = evt.clientX - posX;
                    
var top = evt.clientY - posY;
                    
var limitLeft = 0;
                    
var limitTop = 0;
                    
if(obj.parentNode.nodeName != "BODY")
                    {
                        limitLeft 
= obj.parentNode.clientWidth - obj.clientWidth - offset;
                        
if(limitLeft < left)
                        {
                            left 
= limitLeft;
                        }
                        limitTop 
= obj.parentNode.clientHeight - obj.clientHeight - offset;
                        
if(limitTop < top)
                        {
                            top 
= limitTop;
                        }
                    }
                    
else
                    {
                        limitLeft 
= window.screen.availWidth - obj.clientWidth - offset;
                        
if(limitLeft < left)
                        {
                            left 
= limitLeft;
                        }
                        limitTop 
= window.screen.availHeight - obj.clientHeight - offset;
                        
if(limitTop < top)
                        {
                            top 
= limitTop;
                        }
                    }
                    
if(left < offset)
                    {
                        left 
= offset;
                    }
                    
if(top < offset)
                    {
                        top 
= offset;
                    }
                    obj.style.left 
= left + "px";
                    obj.style.top 
= top + "px";
                }
                
                title.onmousedown 
= function(evt) {
                    
if (!evt) evt = window.event;
                    posX 
= evt.clientX - obj.offsetLeft;
                    posY 
= evt.clientY - obj.offsetTop;
                    document.onmousemove 
= mousemove;
                }

                document.onmouseup 

= function() {
                    document.onmousemove 
= null;
                }
            }
            
else
            {
                alert(
"参数错误!");
            }
        }
    
</script></body>
</html>