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

推荐订阅源

U
Unit 42
C
Cybersecurity and Infrastructure Security Agency CISA
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Know Your Adversary
Know Your Adversary
S
Securelist
I
Intezer
AWS News Blog
AWS News Blog
L
LINUX DO - 热门话题
P
Privacy International News Feed
Recent Announcements
Recent Announcements
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
博客园 - 聂微东
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Attack and Defense Labs
Attack and Defense Labs
N
News and Events Feed by Topic
The GitHub Blog
The GitHub Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Schneier on Security
Schneier on Security
N
Netflix TechBlog - Medium
爱范儿
爱范儿
B
Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
Blog — PlanetScale
Blog — PlanetScale
WordPress大学
WordPress大学
S
Secure Thoughts
K
Kaspersky official blog
N
News | PayPal Newsroom
O
OpenAI News
Last Week in AI
Last Week in AI
C
Check Point Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Cyberwarzone
Cyberwarzone
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Tor Project blog
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
D
Docker
Hugging Face - Blog
Hugging Face - Blog
T
Threat Research - Cisco Blogs
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
博客园 - 司徒正美
Martin Fowler
Martin Fowler
人人都是产品经理
人人都是产品经理
P
Palo Alto Networks Blog

博客园 - 三聪

流操作 如何利用.Net内置类,解析未知复杂Json对象 制作等比环切缩缩图 让window.setTimeout等支持带参数方法 利用NewID()生成随机数 创建缩略图 winform给html提供接口 IE下记住文本框的光标位置 ie下取得iframe里面内容 短网址计算 树冲突 截图片 学习Objective-C: 入门教程 C#根据字节数截取字符串 asp.net本地和全局资料文件的读取方法 Asp.net 利用Jquery Ajax传送和接收DataTable 用一个最简单方法解决asp.net页面刷新导致数据的重复提交 SOS"未将对象引用设置到对象的实例" .NET调PHP Web Service的典型例子
jquery实现点击空白的事件
三聪 · 2010-11-04 · via 博客园 - 三聪

//点击空白扩展
jQuery.fn.extend({
    clickOther: 
function() {
        
if (window.click_other == null) {
            window.click_other 
= new Array();
        }
        window.click_other.push({ target: 
this, func: arguments[0] });
        $(document.body).click(
function(e) {
            
for (var i = 0; i < click_other.length; i++) {
                
var item = window.click_other[i];
                
var target = item.target;
                
if (typeof (target) == "String") target = $(target)[0];if (e.target == target) {
                    
continue;
                }
                
var index = $(e.target).parents().index(target);
                
if (index == -1) {
                    item.func();
                }
            }
        });

    },
    unClickOther: 

function() {
        
if (window.click_other == null) {
            
return;
        }
        
for (var i = 0; i < window.click_other.length; i++) {
            
var item = window.click_other[i];
            
if (item.target == this) {
                window.click_other.splice(i, 
1);
            }
        }
    }
}); 

//点击空白扩展
jQuery.fn.extend({
    clickOther: 
function() {
        
function isInside(e, target) {
            
var x = e.pageX;
            
var y = e.pageY;
            
var left = target.offset().left;
            
var width = target.width();
            
var top = target.offset().top;
            
var height = target.height();if (x > left && x < left + width && y > top && y < top + height) return true;
            
return false;
        }
        
if (window.click_other == null) {
            window.click_other 
= new Array();
        }
        
this.except = null;
        
var func = arguments[0];
        
if (typeof (func) == "string") {
            
this.except = document.getElementById(func);
            func 
= arguments[1];
        }
        window.click_other.push({ target: 
this, func: func });
        $(document).click(
function(e) {
            
for (var i = 0; i < click_other.length; i++) {
                
var item = window.click_other[i];
                
var target = $(item.target);
                
if (isInside(e, target)) continue;
                
if (item.target.except) {
                    
var except = $(item.target.except);
                    
if (isInside(e, except)) continue;
                }
                item.func();
            }
        });

    },
    unclickOther: 

function() {
        
if (window.click_other == null) {
            
return;
        }
        
for (var i = 0; i < window.click_other.length; i++) {
            
var item = window.click_other[i];
            
if (item.target == this) {
                window.click_other.splice(i, 
1);
                
break;
            }
        }
    }
});