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

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
T
Tenable Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
W
WeLiveSecurity
D
DataBreaches.Net
Attack and Defense Labs
Attack and Defense Labs
H
Heimdal Security Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
AI
AI
P
Proofpoint News Feed
PCI Perspectives
PCI Perspectives
Schneier on Security
Schneier on Security
T
Threatpost
GbyAI
GbyAI
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
H
Help Net Security
F
Full Disclosure
T
Threat Research - Cisco Blogs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
M
MIT News - Artificial intelligence
L
Lohrmann on Cybersecurity
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
Y
Y Combinator Blog
腾讯CDC
The Hacker News
The Hacker News
博客园 - Franky
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园_首页
Simon Willison's Weblog
Simon Willison's Weblog
L
LINUX DO - 最新话题
Security Latest
Security Latest
Know Your Adversary
Know Your Adversary
Forbes - Security
Forbes - Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
SegmentFault 最新的问题
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
L
LangChain Blog
Vercel News
Vercel News
Cisco Talos Blog
Cisco Talos Blog
量子位
P
Proofpoint News Feed
H
Hacker News: Front Page
Help Net Security
Help Net Security
L
LINUX DO - 热门话题
Project Zero
Project Zero
C
Cisco Blogs

博客园 - 周末

JS判断IE6,ie7,ie8,ff ASP.NET(C#) 四舍五入、进一法、舍位(取整,舍去小数,向负无穷舍入)函数 在线用户统计的实现方法 HttpModule与HttpHandler详解 IE bug: 1像素的dotted/dashed边框 JS日期计算函数 同时兼容ie和ff的获取事件的方法 关于JS冒泡的问题 jQuery load()方法的美妙用法 CSS 使用expression方法优化 判断 iframe 是否加载完成的完美方法 setCapture,captureEvents,releaseCapture 的技巧。 经典左右两列布局CSS 准确取得当前滚动条的位置 不常用的有意思的标签:optgroup log4net的日志输出格式-log4net.Layout.PatternLayout用法 log4net 将日志按不同类型写入多个文件 FireFox使用技巧 vs2008.net多语言实现方法
兼容各主流浏览器的简单拖拽drag
周末 · 2009-09-24 · via 博客园 - 周末

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title><style type='text/css'> 
#d
{border:1px solid green;width:90px;height:57px;position:absolute;} 
#h
{border:1px solid green;width:90px;height:17px;position:absolute;} 
</style> 
<script type='text/javascript' src="/js/jquery/jquery-1.2.6.min.js"></script>
<script type='text/javascript'> 
(
function($) {
    $.fn.extend({
        drag: 
function(id) {
            $(
this).mousedown(function(event) {
                
var Obj, pX,pY;
                document.onmouseup 
= MUp;
                document.onmousemove 
= MMove;
                MDown(id, event);
                
function MDown(id, event) {
                    Obj 
= document.getElementById(id);
                    
if (Obj.setCapture) 
                        Obj.setCapture();
                    
else 
                        window.captureEvents(Event.MOUSEMOVE 
| Event.MOUSEUP);
                    pX 
= event.clientX - Obj.offsetLeft;
                    pY 
= event.clientY - Obj.offsetTop;
                }
                
function MMove(event) {
                    
if (window.event) event = window.event;
                    
if (Obj) {
                        Obj.style.left 
= event.clientX - pX + "px";
                        Obj.style.top 
= event.clientY - pY + "px";
                    }
                }
                
function MUp(event) {
                    
if (Obj) {
                        
if (Obj.releaseCapture)
                                Obj.releaseCapture();
                        
else 
                            window.captureEvents(Event.MOUSEMOVE 
| Event.MOUSEUP);
                        Obj 
= null;
                    }
                }
            });
        }
    });
})(jQuery); 
</script> 
</head> 
<body> 
<div id="d"> 
<div id="h">Header</div> 
</div> <script type='text/javascript' > 
$(
"#h").drag('d'); //IE下,点击id='h'可拖动id='d',FF兼容待完善 
</script> 
</body>
</html>