title: How to pass variable into jquery animate function properties?
body: <pre><code>function SlideObject(Side) {
      $("#div").animate({
          margin+Side: "-1000px",
          opacity: "hide"
      }, 1000);
  }
  </code></pre>
  
  <p>I would like to pass the value for "Side" into the name of property identifier (margin) for the animate function.</p>
  
  <p>I am  aware that "margin+Side" is not valid it is just there as a place holder. For example if I were to specify the property name manually it could be "marginLeft" to name one example. I would like to supply "Left", "Right", "Top" or "Bottom" as the parameter for the SlideObject function.</p>
  
  <p>I'm having trouble do this and an example would be wonderful.</p>
  
  <p>Thanks</p>