title: Animate position when using js doesn't work, what do I need to use?
body: <p>I have this script which gets fixed when scrolling down 120px. Works great.</p>
  
  <p>But I also need to get my sidebar be default position:absolute; with margin:0;
  AND when scrolling down 120px the sidebar class needs to be position:fixed; and margin-top:50px; I don't think it will be hard to do but I'm not a coder. Can someone help me please?</p>
  
  <p>This doesn't work, for the margin it does but not position, because it can't animate? I can't find any solution yet..</p>
  
  <pre><code>$('.sidebar').animate({'position':'fixed'});
  </code></pre>
  
  <p>My script:</p>
  
  <pre><code>$(document).ready(function(){
    var startY = 120;
    $(window).scroll(function(){
      checkY();
    });
    function checkY(){
      if($(window).scrollTop() &gt; startY ){
        $('.fixedDiv').slideDown(400, function(){});
      }else{
        $('.fixedDiv').slideUp(400, function(){});
      }
    }
    checkY();
  });
  </code></pre>