How to store an object for passing into Animate
I'm trying to clean up my code by re-using objects instead of re-creating them with an object literal every time. Unfortunately, I've discovered that this causes the scripts to halt unexpectedly. Here's an example:
$("#CapabilitiesContent").animate({ 'opacity': 0.0, '-ms-filter':'alpha(opacity=0)', 'filter' : 'alpha(opacity=0)'}, { 'duration': cShiftSpeed, 'queue': false });
$("#DesignGuideContent").animate({ 'opacity': 0.0, '-ms-filter':'alpha(opacity=0)', 'filter' : 'alpha(opacity=0)'}, { 'duration': cShiftSpeed, 'queue': false });
I want to simplify this with:
var HideMe = { 'opacity': 0.0, '-ms-filter':'alpha(opacity=0)', 'filter' : 'alpha(opacity=0)'};
var SimultaneousSlow = { 'duration': cShiftSpeed, 'queue': false };
$("#CapabilitiesContent").animate(HideMe , SimultaneousSlow );
$("#DesignGuideContent").animate(HideMe , SimultaneousSlow );
I believe that the second SHOULD work, and yet it doesn't. Can anyone tell me why, and how to correct the problem?