我有一个插件
$.fn.dropDown = function(options){
this.each(function(){
var $this= $(this);
$(document).click(function(e){
if($(e.target).not($this) && $(e.target).not($this).find('*')){
// do stuff
}
});
});
}我想选择"not this and not everything in this“,到目前为止,这不起作用。
发布于 2011-02-19 04:41:06
这应该是可行的:
var that = this;
$(document).click(function(e) {
if( e.target != that && !$.contains(that, e.target) ) {
// do stuff
}
});https://stackoverflow.com/questions/5046235
复制相似问题