MCPcopy Create free account
hub / github.com/TruthHun/BookStack / swap

Function swap

static/jquery/1.12.4/jquery.js:6493–6511  ·  view source on GitHub ↗
( elem, options, callback, args )

Source from the content-addressed store, hash-verified

6491var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6492
6493var swap = function( elem, options, callback, args ) {
6494 var ret, name,
6495 old = {};
6496
6497 // Remember the old values, and insert the new ones
6498 for ( name in options ) {
6499 old[ name ] = elem.style[ name ];
6500 elem.style[ name ] = options[ name ];
6501 }
6502
6503 ret = callback.apply( elem, args || [] );
6504
6505 // Revert the old values
6506 for ( name in options ) {
6507 elem.style[ name ] = old[ name ];
6508 }
6509
6510 return ret;
6511};
6512
6513
6514var documentElement = document.documentElement;

Callers 1

jquery.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected