MCPcopy Create free account
hub / github.com/JsAaron/jQuery / toggler

Function toggler

1.7/event.js:1005–1015  ·  view source on GitHub ↗
( event )

Source from the content-addressed store, hash-verified

1003 guid = fn.guid || jQuery.guid++,
1004 i = 0,
1005 toggler = function( event ) {
1006 // Figure out which function to execute
1007 var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
1008 jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
1009
1010 // Make sure that clicks stop
1011 event.preventDefault();
1012
1013 // and execute the function
1014 return args[ lastToggle ].apply( this, arguments ) || false;
1015 };
1016
1017 // link all the functions, so any of them can unbind this click handler
1018 toggler.guid = guid;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected