Mercurial > nebulaweb3
comparison default/node_modules/jquery/src/css/var/swap.js @ 0:1d038bc9b3d2 default tip
Up:default
author | Liny <dev@neowd.com> |
---|---|
date | Sat, 31 May 2025 09:21:51 +0800 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1d038bc9b3d2 |
---|---|
1 define( function() { | |
2 | |
3 "use strict"; | |
4 | |
5 // A method for quickly swapping in/out CSS properties to get correct calculations. | |
6 return function( elem, options, callback, args ) { | |
7 var ret, name, | |
8 old = {}; | |
9 | |
10 // Remember the old values, and insert the new ones | |
11 for ( name in options ) { | |
12 old[ name ] = elem.style[ name ]; | |
13 elem.style[ name ] = options[ name ]; | |
14 } | |
15 | |
16 ret = callback.apply( elem, args || [] ); | |
17 | |
18 // Revert the old values | |
19 for ( name in options ) { | |
20 elem.style[ name ] = old[ name ]; | |
21 } | |
22 | |
23 return ret; | |
24 }; | |
25 | |
26 } ); |