Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
26 lines (19 sloc)
520 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define( function() { | |
| "use strict"; | |
| // A method for quickly swapping in/out CSS properties to get correct calculations. | |
| return function( elem, options, callback, args ) { | |
| var ret, name, | |
| old = {}; | |
| // Remember the old values, and insert the new ones | |
| for ( name in options ) { | |
| old[ name ] = elem.style[ name ]; | |
| elem.style[ name ] = options[ name ]; | |
| } | |
| ret = callback.apply( elem, args || [] ); | |
| // Revert the old values | |
| for ( name in options ) { | |
| elem.style[ name ] = old[ name ]; | |
| } | |
| return ret; | |
| }; | |
| } ); |