define( [
"./core",
"./var/document",
"./var/rnotwhite",
"./var/hasOwn",
"./var/slice",
"./event/support",
"./data/var/dataPriv",
"./data/var/acceptData",
"./core/init",
"./selector"
], function( jQuery, document, rnotwhite, hasOwn, slice, support, dataPriv, acceptData ) {
var
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
function returnTrue() {
return true;
}
function returnFalse() {
return false;
}
// Support: IE9
// See #13393 for more info
function safeActiveElement() {
try {
return document.activeElement;
} catch ( err ) { }
}
function on( elem, types, selector, data, fn, one ) {
var origFn, type;
// Types can be a map of types/handlers
if ( typeof types === "object" ) {
// ( types-Object, selector, data )
if ( typeof selector !== "string" ) {
// ( types-Object, data )
data = data || selector;
selector = undefined;
}
for ( type in types ) {
on( elem, type, selector, data, types[ type ], one );
}
return elem;
}
if ( data == null && fn == null ) {
// ( types, fn )
fn = selector;
data = selector = undefined;
} else if ( fn == null ) {
if ( typeof selector === "string" ) {
// ( types, selector, fn )
fn = data;
data = undefined;
} else {
// ( types, data, fn )
fn = data;
data = selector;
selector = undefined;
}
}
if ( fn === false ) {
fn = returnFalse;
}
if ( one === 1 ) {
origFn = fn;
fn = function( event ) {
// Can use an empty set, since event contains the info
jQuery().off( event );
return origFn.apply( this, arguments );
};
// Use same guid so caller can remove using origFn
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
}
return elem.each( function() {
jQuery.event.add( this, types, fn, data, selector );
} );
}
/*
* Helper functions for managing events -- not part of the public interface.
* Props to Dean Edwards' addEvent library for many of the ideas.
*/
jQuery.event = {
global: {},
add: function( elem, types, handler, data, selector ) {
var handleObjIn, eventHandle, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
elemData = dataPriv.get( elem );
// Don't attach events to noData or text/comment nodes (but allow plain objects)
if ( !elemData ) {
return;
}
// Caller can pass in an object of custom data in lieu of the handler
if ( handler.handler ) {
handleObjIn = handler;
handler = handleObjIn.handler;
selector = handleObjIn.selector;
}
// Make sure that the handler has a unique ID, used to find/remove it later
if ( !handler.guid ) {
handler.guid = jQuery.guid++;
}
// Init the element's event structure and main handler, if this is the first
if ( !( events = elemData.events ) ) {
events = elemData.events = {};
}
if ( !( eventHandle = elemData.handle ) ) {
eventHandle = elemData.handle = function( e ) {
// Discard the second event of a jQuery.event.trigger() and
// when an event is called after a page has unloaded
return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
jQuery.event.dispatch.apply( elem, arguments ) : undefined;
};
}
// Handle multiple events separated by a space
types = ( types || "" ).match( rnotwhite ) || [ "" ];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[ t ] ) || [];
type = origType = tmp[ 1 ];
namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
// There *must* be a type, no attaching namespace-only handlers
if ( !type ) {
continue;
}
// If event changes its type, use the special event handlers for the changed type
special = jQuery.event.special[ type ] || {};
// If selector defined, determine special event api type, otherwise given type
type = ( selector ? special.delegateType : special.bindType ) || type;
// Update special based on newly reset type
special = jQuery.event.special[ type ] || {};
// handleObj is passed to all event handlers
handleObj = jQuery.extend( {
type: type,
origType: origType,
data: data,
handler: handler,
guid: handler.guid,
selector: selector,
needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
namespace: namespaces.join( "." )
}, handleObjIn );
// Init the event handler queue if we're the first
if ( !( handlers = events[ type ] ) ) {
handlers = events[ type ] = [];
handlers.delegateCount = 0;
// Only use addEventListener if the special events handler returns false
if ( !special.setup ||
special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
if ( elem.addEventListener ) {
elem.addEventListener( type, eventHandle );
}
}
}
if ( special.add ) {
special.add.call( elem, handleObj );
if ( !handleObj.handler.guid ) {
handleObj.handler.guid = handler.guid;
}
}
// Add to the element's handler list, delegates in front
if ( selector ) {
handlers.splice( handlers.delegateCount++, 0, handleObj );
} else {
handlers.push( handleObj );
}
// Keep track of which events have ever been used, for event optimization
jQuery.event.global[ type ] = true;
}
},
// Detach an event or set of events from an element
remove: function( elem, types, handler, selector, mappedTypes ) {
var j, origCount, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
if ( !elemData || !( events = elemData.events ) ) {
return;
}
// Once for each type.namespace in types; type may be omitted
types = ( types || "" ).match( rnotwhite ) || [ "" ];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[ t ] ) || [];
type = origType = tmp[ 1 ];
namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
// Unbind all events (on this namespace, if provided) for the element
if ( !type ) {
for ( type in events ) {
jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
}
continue;
}
special = jQuery.event.special[ type ] || {};
type = ( selector ? special.delegateType : special.bindType ) || type;
handlers = events[ type ] || [];
tmp = tmp[ 2 ] &&
new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
// Remove matching events
origCount = j = handlers.length;
while ( j-- ) {
handleObj = handlers[ j ];
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector ||
selector === "**" && handleObj.selector ) ) {
handlers.splice( j, 1 );
if ( handleObj.selector ) {
handlers.delegateCount--;
}
if ( special.remove ) {
special.remove.call( elem, handleObj );
}
}
}
// Remove generic event handler if we removed something and no more handlers exist
// (avoids potential for endless recursion during removal of special event handlers)
if ( origCount && !handlers.length ) {
if ( !special.teardown ||
special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
jQuery.removeEvent( elem, type, elemData.handle );
}
delete events[ type ];
}
}
// Remove data and the expando if it's no longer used
if ( jQuery.isEmptyObject( events ) ) {
dataPriv.remove( elem, "handle events" );
}
},
trigger: function( event, data, elem, onlyHandlers ) {
var i, cur, tmp, bubbleType, ontype, handle, special,
eventPath = [ elem || document ],
type = hasOwn.call( event, "type" ) ? event.type : event,
namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
cur = tmp = elem = elem || document;
// Don't d
没有合适的资源?快使用搜索试试~ 我知道了~
jquery-1.11源码
共95个文件
js:94个
jshintrc:1个
3星 · 超过75%的资源 需积分: 9 86 下载量 133 浏览量
2015-09-28
11:17:10
上传
评论
收藏 83KB RAR 举报
温馨提示
从github下载下来的最新jquery1.11源码,github地址:https://github.com/jquery/jquery
资源推荐
资源详情
资源评论
收起资源包目录
jquery_1.11源码.rar (95个子文件)
src
css
support.js 2KB
adjustCSS.js 2KB
showHide.js 989B
var
getStyles.js 371B
rnumnonpx.js 115B
swap.js 505B
rmargin.js 49B
isHidden.js 362B
cssExpand.js 72B
curCSS.js 1KB
hiddenVisibleSelectors.js 302B
addGetHookIf.js 515B
core.js 11KB
jquery.js 586B
core
support.js 612B
var
rsingleTag.js 99B
parseHTML.js 1KB
init.js 3KB
ready.js 2KB
access.js 1KB
selector.js 50B
attributes
support.js 754B
val.js 4KB
classes.js 4KB
prop.js 2KB
attr.js 3KB
data
Data.js 4KB
var
dataPriv.js 68B
acceptData.js 323B
dataUser.js 68B
effects.js 17KB
ajax.js 21KB
event.js 25KB
selector-sizzle.js 318B
wrap.js 1KB
deferred.js 10KB
var
support.js 102B
document.js 51B
toString.js 88B
concat.js 65B
indexOf.js 66B
rnotwhite.js 46B
slice.js 64B
hasOwn.js 94B
class2type.js 67B
arr.js 38B
rcssNum.js 121B
pnum.js 84B
documentElement.js 89B
push.js 63B
outro.js 20B
deprecated.js 26B
ajax
load.js 2KB
var
location.js 51B
nonce.js 75B
rquery.js 44B
xhr.js 3KB
parseXML.js 480B
parseJSON.js 109B
jsonp.js 3KB
script.js 1KB
effects
Tween.js 3KB
animatedSelector.js 229B
traversing
findFilter.js 2KB
var
dir.js 356B
rneedsContext.js 112B
siblings.js 203B
attributes.js 202B
dimensions.js 2KB
intro.js 1KB
serialize.js 3KB
offset.js 6KB
callbacks.js 5KB
manipulation.js 12KB
manipulation
support.js 1000B
_evalUrl.js 341B
getAll.js 539B
var
rcheckableType.js 63B
rscriptType.js 67B
rtagName.js 52B
wrapMap.js 767B
setGlobalEval.js 366B
buildFragment.js 2KB
exports
global.js 531B
amd.js 1009B
queue.js 3KB
event
support.js 118B
ajax.js 331B
alias.js 1KB
.jshintrc 475B
queue
delay.js 620B
selector-native.js 4KB
data.js 4KB
css.js 11KB
traversing.js 4KB
共 95 条
- 1
资源评论
- showip20122015-10-06感謝LZ收集,用起來挺方便
- nyhyeah12015-10-05有不少例子可以参考,目前正需要
jump_alang
- 粉丝: 8
- 资源: 21
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功