| 1066 | |
| 1067 | // 生成show,hide,toggle动画属性 |
| 1068 | function genFx(type, opts) { |
| 1069 | var pros = { |
| 1070 | o: ['opacity',], |
| 1071 | h: ['width', 'paddingLeft', 'paddingRight', 'borderLeftWidth', 'borderRightWidth', 'marginLeft', 'marginRight',], |
| 1072 | v: ['height', 'paddingTop', 'paddingBottom', 'borderTopWidth', 'borderBottomWidth', 'marginTop', 'marginBottom',], |
| 1073 | }; |
| 1074 | |
| 1075 | var ret = {}; |
| 1076 | for (var i in pros) { |
| 1077 | if (!pros.hasOwnProperty(i)) continue; |
| 1078 | if (opts[i]) { |
| 1079 | pros[i].forEach(function (pro) { |
| 1080 | ret[pro] = type; |
| 1081 | }); |
| 1082 | }; |
| 1083 | }; |
| 1084 | |
| 1085 | return ret; |
| 1086 | }; |
| 1087 | |
| 1088 | // 绘制动画 |
| 1089 | function draw() { |